internal exception postUrl API call in custom function
Hello,
I have a custom function written that makes a PostUrl API call to Hubspot CRM to create deals. It works for me in Postman, however I am getting an "internal exception" when I execute it.
Here is the function code:
- myMap=map();
- myMap.put("Content Type","application/json");
- params="{\"associations\": {\"associatedCompanyIds\": [\"" + input.aHScompanyId + "\"],\"associatedVids\": [\"" + ccHSid + "\"]},\"properties\": [{\"value\": \"" + input.pPotentialName + "\",\"name\": \"dealname\"},{\"value\": \"" + ppAmount + "\",\"name\": \"amount\"},{\"value\":\"newbusiness\",\"name\": \"dealtype\"},{\"value\":\"7\",\"name\": \"hubspot_owner_id\"}]}";
- resp = postUrl("https://api.hubapi.com/deals/v1/deal/?hapikey=xxxxx-xxxx-xxx-xxxx-xxxxxx",params,myMap);
- info resp;