Node JS SDK Errors and Solutions

Access denied for user

Reason

This error occurs when the user hasn't set the "configuration.properties" or the "oauth_configuration.properties" file.

Solution

Provide the necessary keys in the "oauth_configuration.properties" and the "configuration.properties" file.

Invalid Code

Reason

The grant token has expired.

Solution

Regenerate the grant token and use it to generate a new access token within the stipulated time.

Invalid Client

Reason

The user tries to generate grant token and access token from different domains. For example, the user generates the grant token from www.accounts.zoho.com and tries to generate the access token from www.accounts.zoho.eu.

Solution

Use the same domain.

Invalid OAuth token

Reason

The user has generated access token and is trying to access module record from different domains. For example, the user generates the access token from 'accounts.zoho.com' and tries to fetch module record data from 'accounts.zoho.eu'.

Solution

Use the same domain.

Cannot read property 'statusCode' of undefined

Reason

The "api.url" key in the configuration dictionary must have had the value as "https://www.zohoapis.com/". The slash at the end of the line is automatically added by the SDK. Hence if the user adds a slash as well, the final input to the SDK will have two slashes. Ex: "https://www.zohoapis.com//".

Solution

Remove the (/) slash after https://www.zohoapis.com in the "api.url" key of the configuration dictionary.

SyntaxError:Unexpected token

Reason

The "crm.iamurl" key in the configuration dictionary must have had the value as "https://accounts.zoho.com/". The slash at the end of the line is automatically added added by the SDK. Hence if the user adds a slash as well, the final input to the SDK will have two slashes. Ex: "https://accounts.zoho.com//".

Solution

Remove the (/) slash after https://accounts.zoho.com in the "crm.iamurl" key of the configuration dictionary.