Python SDK - Overview
Zoho CRM Python SDK offers a way to create client Python applications that can be integrated with Zoho CRM.
A point to note would be that the developer of the client application should create programming code elements along with interface implementations, instances or objects. Authentication to access Zoho CRM APIs is through OAuth2.0 authentication mechanism. Invariably, HTTP requests and responses are taken care of by the SDK.
A sample of how an SDK acts a middleware or interface between Zoho CRM and a client Python application.
Python SDK allows you to:
- Exchange data between Zoho CRM and the client application where the CRM entities are modelled as classes.
- CRM API equivalents are declared and defined as simple member methods in your Python application.
- Push data into Zoho CRM, by accessing appropriate APIs of the CRM Service.
Environmental Setup
Python SDK is installable through pip. pip is a tool for dependency management in Python. SDK expects the following from the client app:
- Client app must have Python(version 3 and above)or above
- Python SDK must be installed into client app through pip.
Including SDK in your Project
- Install Python from python.org (if not installed).
- Install Python SDK
- Navigate to the workspace of your client app.
- Run the command below:
pip install zohocrmsdk2_1==1.x.x
- The Python SDK will be installed in your client application.
The access and refresh tokens are environment-specific and domain-specific. When you handle various environments and domains such as Production, Sandbox, or Developer and IN, CN, US, EU, or AU, respectively, you must use the access token and refresh token generated only in those respective environments and domains. The SDK throws an error, otherwise.
For example, if you generate the tokens for your Sandbox environment in the CN domain, you must use only those tokens for that domain and environment. You cannot use the tokens generated for a different environment or a domain.For Contact Roles and Records API, you will need to provide the ZohoCRM.settings.fields.ALL scope along with the ZohoCRM.modules.ALL scope while generating the OAuthtoken. Otherwise, the system returns the OAUTH-SCOPE-MISMATCH error
For Related Records API, the scopes required for generating OAuthtoken are ZohoCRM.modules.ALL, ZohoCRM.settings.fields.ALL and ZohoCRM.settings.related_lists.ALL. Otherwise, the system returns the OAUTH-SCOPE-MISMATCH error