Hello,
I am having trouble to udpate any parameter using the API.
I am pretty sure that I am sending a correct Token and that it has the needed scope (Desk.contacts.UPDATE).
First I tried sending the whole information, but got the error, and I ma still getting the same error by just sending just one parameter:
- async function updateCompany(accountId, params){
- let headers = httpCalls.buildHeaders();
- let url = `https://desk.zoho.com/api/v1/accounts/${accountId}`;
- let payload = JSON.stringify(params);
- let opts = {
- "method":"PATCH",
- "headers":headers,
- "payload":payload
- }
- let answer = await UrlFetchApp.fetch(url,opts);
- return {
- status: answer.getResponseCode(),
- msg: answer.getContentText()
- }
- }
- async function testUpdate(){
- let verifiedId = 65046501652005 /*This number is just to show how it is called, the actual number it is of course a valid accountId*/
- let info = {
- accountName: "AccountName"
- }
- console.log(JSON.stringify(info));
- let answer = await updateCompany(verifiedId, info);
-
- console.log(answer);
- }
I am pretty sure that headers and accountId are valid because I can get the company info with those same parameters, but no luck to update.
Any thoughts on this? Thank you in advance