For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.

Zoho CRM/Creator - Common Errors & Gotchas

What?
A quick article on how to debug some errors in Zoho.

Why?
I wanted a general note to list certain errors that we get when we do certain things in Zoho but didn't want to write a separate page for each minor issue.

How?
So I'm going to try and list solutions to minor errors we run into.

Problem: Zoho OAuth Connection: ERROR_invalid_operation_type
Sounds rather straightforward, Login to ZohoCRM as Administrator > Setup > Developer Space > Connections > Add Connection > Give it a name and then select Scopes > and get
copyraw
ERROR_invalid_operation_type
  1.  ERROR_invalid_operation_type 
Solution: Remove some scopes and test.
The likely ones you want are:
copyraw
ZohoCRM.modules.ALL
ZohoCRM.settings.ALL
ZohoCRM.users.ALL

or to be safe

ZohoCRM.modules.ALL
ZohoCRM.settings.READ
ZohoCRM.users.READ
  1.  ZohoCRM.modules.ALL 
  2.  ZohoCRM.settings.ALL 
  3.  ZohoCRM.users.ALL 
  4.   
  5.  or to be safe 
  6.   
  7.  ZohoCRM.modules.ALL 
  8.  ZohoCRM.settings.READ 
  9.  ZohoCRM.users.READ 

Problem: Code 37: The HTTP method PUT is not allowed for the requested resource
This was an issue where I was trying to push a Zoho Creator record into Zoho Inventory via an invokeURL with API v2 rather than a connector. If you use POST then this adds/creates a record and if it already exists you will get a {"code":1001,"message":"Item \"...\" already exists."}. Documentation advises that the payload is empty which is not true in my case. This is my invokeUrl:
copyraw
v_DataEndpoint = "https://inventory.zoho.com/api/v1/items?organization_id=123456789";
r_Response = invokeurl
[
	url :v_DataEndpoint
	type :POST
	parameters:m_CreateRecord
	headers:m_Header
];
  1.  v_DataEndpoint = "https://inventory.zoho.com/api/v1/items?organization_id=123456789"
  2.  r_Response = invokeurl 
  3.  [ 
  4.      url :v_DataEndpoint 
  5.      type :POST 
  6.      parameters:m_CreateRecord 
  7.      headers:m_Header 
  8.  ]
Solution: My endpoint was the same as a create/add record when it should be suffixed with the ID of the item to update:
copyraw
v_DataEndpoint = "https://inventory.zoho.com/api/v1/items/{item_id}?organization_id=123456789";
r_Response = invokeurl
[
	url :v_DataEndpoint
	type :PUT
	parameters:m_CreateRecord
	headers:m_Header
];
  1.  v_DataEndpoint = "https://inventory.zoho.com/api/v1/items/{item_id}?organization_id=123456789"
  2.  r_Response = invokeurl 
  3.  [ 
  4.      url :v_DataEndpoint 
  5.      type :PUT 
  6.      parameters:m_CreateRecord 
  7.      headers:m_Header 
  8.  ]

Problem: Value is empty and 'get' function cannot be applied
Following a post similar to the above example by InvokeURL and then getting a JSON response back, the response does not seem to be read as a map:
copyraw
r_Response = invokeurl
[
	url :v_DataEndpoint
	type :POST
	parameters:m_CreateRecord
	headers:m_Header
];
info r_Response;
// yields: { "code": 0, "message": "The item has been added.", "item": { "item_id": "2124100000000081031", .... }}

info r_Response.get("item");
// yields: "item_id": "2124100000000081031", .... 

info r_Response.get("item").get("item_id");
// yields: Value is empty and 'get' function cannot be applied
  1.  r_Response = invokeurl 
  2.  [ 
  3.      url :v_DataEndpoint 
  4.      type :POST 
  5.      parameters:m_CreateRecord 
  6.      headers:m_Header 
  7.  ]
  8.  info r_Response; 
  9.  // yields: { "code": 0, "message": "The item has been added.", "item": { "item_id": "2124100000000081031", .... }} 
  10.   
  11.  info r_Response.get("item")
  12.  // yields: "item_id": "2124100000000081031", .... 
  13.   
  14.  info r_Response.get("item").get("item_id")
  15.  // yields: Value is empty and 'get' function cannot be applied 
Solution: I have to convert the node into a map:
copyraw
info m_Response.get("item").toMap().get("item_id");
// yields: 123456789012345678
  1.  info m_Response.get("item").toMap().get("item_id")
  2.  // yields: 123456789012345678 

Problem: Inserting a date time string into a date time field in Deluge
So annoying but sometimes you want to insert a date/time value into a date/time field and you get the error:
copyraw
v_MyDateTimeString = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ssZ");
// value is "2020-02-10T11:49:12+0100"

// yields
{"code":"INVALID_DATA","details":{"expected_data_type":"datetime","api_name":"Updated_DateTime"},"message":"invalid data","status":"error"}
  1.  v_MyDateTimeString = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ssZ")
  2.  // value is "2020-02-10T11:49:12+0100" 
  3.   
  4.  // yields 
  5.  {"code":"INVALID_DATA","details":{"expected_data_type":"datetime","api_name":"Updated_DateTime"},"message":"invalid data","status":"error"} 
Solution: The above ALMOST works for API and Deluge Shortcode, but we're missing the colon in the TimeZone value:
copyraw
v_TimeZone = zoho.currentdate.toString("Z");
v_TimeZoneStr = v_TimeZone.substring(0,3) + ":" + v_TimeZone.substring(3);
v_InsertDateTime = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ss") + v_TimeZoneStr;
// value is "2020-02-10T11:49:12+01:00"

// OR in some cases
v_TimeZone = "Europe/London";
v_InsertDateTime = zoho.currenttime.toString("yyyy-MM-dd HH:mm:ss",v_TimeZone);
  1.  v_TimeZone = zoho.currentdate.toString("Z")
  2.  v_TimeZoneStr = v_TimeZone.substring(0,3) + ":" + v_TimeZone.substring(3)
  3.  v_InsertDateTime = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ss") + v_TimeZoneStr; 
  4.  // value is "2020-02-10T11:49:12+01:00" 
  5.   
  6.  // OR in some cases 
  7.  v_TimeZone = "Europe/London"
  8.  v_InsertDateTime = zoho.currenttime.toString("yyyy-MM-dd HH:mm:ss",v_TimeZone)

Problem: ERROR_Invalid_Redirect_URI
Can happen when trying to setup an OAuth connection:
copyraw
ERROR_Invalid_Redirect_URI
  1.  ERROR_Invalid_Redirect_URI 
Solution: The redirect URI in your app does not match the redirect used in the authorization request. They need to match in both irrespective of the value. Consider trying to get authorized and checking the Redirect URI passed in the URL and then updating your app with the same value, such as:
copyraw
// for Books OAuth 2.0 Connection - Custom Service - on account server EU
https://dre.zoho.eu/delugeauth/callback

// for Books OAuth 2.0 Connection - Custom Service - on account server COM
https://dre.zoho.com/delugeauth/callback

// for Inventory OAuth 2.0 Connection - Custom Service - on account server COM
https://deluge.zoho.com/delugeauth/callback
  1.  // for Books OAuth 2.0 Connection - Custom Service - on account server EU 
  2.  https://dre.zoho.eu/delugeauth/callback 
  3.   
  4.  // for Books OAuth 2.0 Connection - Custom Service - on account server COM 
  5.  https://dre.zoho.com/delugeauth/callback 
  6.   
  7.  // for Inventory OAuth 2.0 Connection - Custom Service - on account server COM 
  8.  https://deluge.zoho.com/delugeauth/callback 

Problem: Split a string with the escape character/backslash character
Trying to split a string into a list by the backslash character:
copyraw
v_File = "C:\Documents\My_File.txt";
// want to extract My_File.txt

l_FileParts = v_File.toList("\\");
info l_FileParts.get(l_FileParts.size() - 1);
// yields C:\Documents\My_File.txt
  1.  v_File = "C:\Documents\My_File.txt"
  2.  // want to extract My_File.txt 
  3.   
  4.  l_FileParts = v_File.toList("\\")
  5.  info l_FileParts.get(l_FileParts.size() - 1)
  6.  // yields C:\Documents\My_File.txt 
Solution: Replace the backslash first with another character:
copyraw
v_File = "C:\Documents\My_File.txt";
v_FileString = v_File.toString().replaceAll("\\", "|");
// yields C:|Documents|My_File.txt

l_FileParts = v_FileString.toList("|");
v_ThisPart = l_FileParts.get(l_FileParts.size() - 1);
// yields My_File.txt
  1.  v_File = "C:\Documents\My_File.txt"
  2.  v_FileString = v_File.toString().replaceAll("\\", "|")
  3.  // yields C:|Documents|My_File.txt 
  4.   
  5.  l_FileParts = v_FileString.toList("|")
  6.  v_ThisPart = l_FileParts.get(l_FileParts.size() - 1)
  7.  // yields My_File.txt 

Problem: Code 57: You are not authorized to perform this operation
This is a quick issue to resolve as it may be incorrect scopes specified but in my case is more than often the wrong accounts server:
copyraw
v_DataEndpoint = "https://books.zoho.com/api/v3/contacts?organization_id=123456789";
r_Response = invokeurl
[
	url :v_DataEndpoint
	type :GET
	connection: myConnector
];
  1.  v_DataEndpoint = "https://books.zoho.com/api/v3/contacts?organization_id=123456789"
  2.  r_Response = invokeurl 
  3.  [ 
  4.      url :v_DataEndpoint 
  5.      type :GET 
  6.      connection: myConnector 
  7.  ]
Solution: My endpoint was specifying COM instead of EU as per the client's data center:
copyraw
v_DataEndpoint = "https://books.zoho.eu/api/v3/contacts?organization_id=123456789";
r_Response = invokeurl
[
	url :v_DataEndpoint
	type :GET
	connection: myConnector
];
  1.  v_DataEndpoint = "https://books.zoho.eu/api/v3/contacts?organization_id=123456789"
  2.  r_Response = invokeurl 
  3.  [ 
  4.      url :v_DataEndpoint 
  5.      type :GET 
  6.      connection: myConnector 
  7.  ]
Category: Zoho CRM :: Article: 253

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com