I have a function that is trigger by a workflow rule responding to an create/edit of an event.
If the event meet the specified criteria, a specific task belonging to the same contact needs to be updated as being completed. When the task is completed manually, a workflow rule is triggered that performs additional actions.
I understand that in Zoho CRM, an update to an entity from a workflow rule action does not trigger the workflow rule on the entity that was updated. I've read here in the community that this needs to be updated through the API.
Here's where I am stuck.
In the function, I have the taskId I want to update. I want to set the Status to Completed and the value of a custom field on the task. And then make sure that the workflow rule associated with the task being completed is triggered.
I am trying to use invokeurl, but getting permissions error. In the code above this is where I determine taskId and outcome, they both have correct values.
resp = invokeurl
[
url: "https://www.zohoapis.com/crm/v2/Tasks/" + taskId
type: PUT
parameters: {"Status":"Completed", "Sales_Outcome":outcome}
];
info resp;
My response is always:
{"code":"AUTHENTICATION_FAILURE","details":{},"message":"Authentication failed","status":"error"}
What am I missing?
Thanks