Help with postURL and putURL

Hi,

Both util.postURL and util.putURL have two paramters:

  • urlstring which I understand it the field_id=value array

  • putBody I am not sure what to put here

I looked at all the documents and do not seem to see examples of what putBody should contain.
Can someone please share a sample script for me to use as reference for the putURL or postURL.

Thanks so much

Did you ever figure this out? I will be implementing this in the future, but there’s still not much on it. I assume it works the same as https.request() and the body is a stringify’d json.

Hi,

Yes, it works well and allowed us to sync Freshdesk tickets and Notes into a clients Ragic Call and Journals (both ways) together with specific business logic to help them stay within the SLA.

Here is some sample code:

util.setHeader("Content-Type", "application/json")
util.setHeader("Authorization", "Basic SWU5YkNVejhzOWtOcXZtaXUwYVE6WA====")
var urlCall = "https://" + domainURL + "/api/v2/tickets/" + pKey;
//response.setMessage(urlCall);
var respCall = util.getURL(urlCall); 

then add your parse after this

Regards

1 Like