For Zoho Services only:


I'm actually part of a bigger team at Ascent Business Solutions where we have support technicians and project consultants. Support is for smaller technical fixes but this can include developments, reports or integrations; depending on the size of the task. Projects are for more time-consuming developments such as revamps of the Zoho Suite of apps or on-site training. The advantage of a team is that if I am out-of-office for a day or so, there is always someone at Ascent Business Solutions who can deal with any queries/issues you may have.

Our support rates can be found and purchased at http://ascentbusiness.co.uk/zoho-support-2. A support bundle doesn't have an expiry date. So whether we can do what you want within the bundle and a year later need further support, if there are minutes left on the bundle then there is no additional charge.

Our project rates for bigger developments can be found at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices and will involve a dedicated project consultant along with developers who will hold your hand through the development process.

If you want help building a solution for one of the Zoho Apps in the Zoho Suite, contact us on 0121 293 8140 (UK) or by email at info@ascentbusiness.co.uk. You can also visit our website at http://ascentbusiness.co.uk.

I regularly build and specialize in 2-way API integrations for Xero, Shopify and eBay.

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: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used 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 - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.