C# SDK Errors and Solutions

Client Id is mandatory

Reason

Configuration properties not given in the file.

Solution

Set configuration properties as displayed in the below image.

Exception while fetching access tokens from refresh tokens

Reason

The grant token has expired.

Solution

Regenerate grant token and use within the stipulated time.

(401) Unauthorized

Reason

The user has not included the scope “Aaaserver.profile.Read” while generating the grant token(authorization code).

Solution

Include the scope “Aaaserver.profile.Read” while generating the grant token(authorization code).

User not available in persistence

Reason

The provided 'current' user email not found in database. Hence, token wasn't generated.

Solution

Generate tokens for the respective user.

Current user must be either set in ZCRMRestClient or ZCRMConfiguration

Reason

The currentUserEmail must have been left empty.

Solution

Specify the currentUserEmail.

Invalid URI format

Reason

The SDK is not initialized by not calling ZCRMRestClient::initialize().

Solution

Follow the steps mentioned in Initialization - C# SDK to initialize the SDK.

Unable to generate access token

Reason

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

Solution

Generate both grant token and access token from 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.

Unable to connect the remote server

Reason

The apiBaseUrl 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 "apiBaseUrl" key of the confirguration dictionary.

The remote sever returned an error:(404) Not Found.

Reason

The 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 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 "iamURL" key of the configuration dictionary.

Unable to connect the remote server

Reason

The "apiVersion" key in the configuration dictionary is "V2", with a capital "V".

Solution

Change the value of apiVersion to "v2" in the configuration dictionary.