For Zoho Services only:


I'm actually part of something bigger at Ascent Business Solutions recognized as the top Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions offer support for smaller technical fixes and projects for larger developments, such as migrating to a ZohoCRM.  A team rather than a one-man-band is always available to ensure seamless progress and address any concerns. You'll find our competitive support rates with flexible, no-expiration bundles at https://ascentbusiness.co.uk/zoho-services/uk-zoho-support.  For larger projects, talk to our experts and receive dedicated support from our hands-on project consultants at https://ascentbusiness.co.uk/zoho-services/zoho-crm-implementation.

The team I manage specializes in coding API integrations between Zoho and third-party finance/commerce suites such as Xero, Shopify, WooCommerce, and eBay; to name but a few.  Our passion lies in creating innovative solutions where others have fallen short as well as working with new businesses, new sectors, and new ideas.  Our success is measured by the growth and ROI we deliver for clients, such as transforming a garden shed hobby into a 250k monthly turnover operation or generating a +60% return in just three days after launch through online payments and a streamlined e-commerce solution, replacing a paper-based system.

If you're looking for a partner who can help you drive growth and success, we'd love to work with you.  You can reach out to us on 0121 392 8140 (UK) or info@ascentbusiness.co.uk.  You can also visit our website at https://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 :: Article: 704

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

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

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
© 2024 Joel Lipman .com. All Rights Reserved.