Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function agent(agentID, ticketId) {
- var API_KEY = "F4YhFJLDl03YomZFcYS";
- var FD_ENDPOINT = "movavi";
- var PATH = "/api/v2/tickets";
- var URL = "https://" + FD_ENDPOINT + ".freshdesk.com" + PATH + "/" + ticketId;
- var fields = {
- 'responder_id': agentID
- };
- var Request = unirest.put(URL);
- Request.auth({
- user: API_KEY,
- pass: "X",
- sendImmediately: true
- })
- .type('json')
- .send(fields)
- .end(function (response) {
- //console.log('----------------------------');
- //console.log(response.body);
- console.log("update.agent Response Status : " + response.status);
- //console.log('----------------------------');
- if (response.status != 200) {
- console.log('agentID: ' + agentID, typeof agentID);
- console.log('update.agent Response: ' + JSON.stringify(response.body));
- console.log("update.agent X-Request-Id :" + response.headers['x-request-id']);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement