Python SDK Errors and Solutions

No OAuth and Configuration Properties

Reason

The user has not set the configuration properties or the OAuth properties.

Solution

Set configuration and OAuth configuration properties as displayed in the below image.

Invalid Code

Reason

The user's grant token(authorization code) has expired.

Solution

Regenerate the grant token and use within the stipulated time.

KeyError: 'Email'

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).

Exception occurred while fetching OAuthtoken from DB

Reason

The email ID of the current user(currentUserEmail) is not found in the database because the access token is not generated for that user.

Solution

Generate access token for that user.

currentUserEmail value is missing

Reason

The email ID of the current user is not specified in the field "currentUserEmail".

Solution

Enter the email ID of the current user in the "currentUserEmail" field.

SDK not Initialized

Reason

The SDK is not initialized.

Solution

Follow the steps mentioned in Initialization - Python SDK to initialize the SDK.

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 '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 generates access token in a domain but tries to access a record in a different domain. For example, the user generates the access token from www.zohoapis.com and tries to access a module in www.zohoapis.eu

Solution

Access the records in the same domain as you generated the access token in.

The Object is not JSON Serializable

Reason

An incorrect object is passed that cannot be serialized into JSON.

Solution

Use the instance variable "data" to get the entity data alone from the response wrapper objects. In the example, use "resp.data"

ZCRMException Caused by:'Unknown ZCRMException'

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 configuration dictionary.

ZohoOAuthException Caused by:'ZohoOAuthException Caused by:'Exception while fetching access token from refresh token - HTTP/1.1 404

Reason

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

ZCRMException Caused by:'Unknown ZCRMException'

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.