Adding contact role to a specific deal js sdk malfunctioning
i was trying to add the contact role to a specific deal contact but repeatedly i am getting this error:
{
"code": "SUCCESS",
"details": {
"statusMessage": {
"code": "INVALID_DATA",
"details": {
"expected_data_type": "jsonobject"
},
"message": "body",
"status": "error"
},
"status": "true"
},
"message": "Connection invoked successfully",
"status": "success",
"$responseHeaders": {
"x-ratelimit-remaining": null,
"x-ratelimit-limit": null,
"x-ratelimit-reset": null
}
}
My code:
const payload = {
data: [
{
Contact_Role: {
id: roleId,
},
},
],
};
const response = await ZOHO.CRM.CONNECTION.invoke("crm_connection", {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
console.log("Zoho CRM Response:", response);
Struggling a lot, no matter how i do this, i am getting the same result.