Skip to main content

Zoho CRM connector

Project description

Zoho CRM Connector

Zoho provides a Python SDK, but it is Python 2.7 and I ran into some bugs. Also, it has a dependency on mysql as a hard-coded database layer.

It uses requests with session retry, and at present this is not configurable.

Install

pip install zoho_crm_connector

Authenticating with Zoho CRM

# notes on sandbox account: https://help.zoho.com/portal/community/topic/api-has-a-sandbox-environment

You need three things:

  1. refresh token

  2. client ID

  3. client secret

These instructions are from the documentation from Zoho for the Python SDK

Step 1: Registering a Zoho Client

Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:

Visit this page https://accounts.zoho.com/developerconsole. Click on “Add Client ID”. Enter Client Name, Client Domain and Redirect URI. Select the Client Type as “Web based”. Click “Create” Your Client app would have been created and displayed by now. The newly registered app’s Client ID and Client Secret can be found by clicking Options → Edit. (Options is the three dot icon at the right corner).

Step 2: Generating self-authorized grant and refresh token

For self client apps, the self authorized grant token should be generated from the Zoho Developer Console (https://accounts.zoho.com/developerconsole)

Visit https://accounts.zoho.com/developerconsole Click Options → Self Client of the client for which you wish to authorize. Enter one or more (comma separated) valid Zoho CRM scopes that you wish to authorize in the “Scope” field and choose the time of expiry. Provide “aaaserver.profile.READ” scope along with Zoho CRM scopes. scope can be

ZohoCRM.modules.all,ZohoCRM.users.all,ZohoCRM.org.all,ZohoCRM.settings.all,aaaserver.profile.READ

Copy the grant token for backup. It expires soon, so use it to make a refresh_token

Generate refresh_token from grant token by making a POST request with the URL below You can’t do POST requests by entering in the browser:

https://accounts.zoho.com/oauth/v2/token?code={grant_token}&redirect_uri={redirect_uri}&client_id={client_id}&client_secret={client_secret}&grant_type=authorization_code

this works with curl:

curl -d "code=1000.2f...68&redirect_uri=https://www.growthpath.com.au/callback&client_id=1000.ZZZZ...99&client_secret=bzz...123&grant_type=authorization_code" -X POST https://accounts.zoho.com/oauth/v2/token

Copy the refresh token … this doesn’t expire, and it’s how access is granted

Usage

See test_zoho_crm_connector.py in tests for some examples.

Testing

pytest needs to be installed.

Warning: testing writes an access token to a temporary directory provided by pytest, on linux this is a subdirectory of /tmp. testing needs a connection to zoho. Set three environment variables:

'refresh_token': os.getenv('ZOHOCRM_REFRESH_TOKEN'),
 'client_id': os.getenv('ZOHOCRM_CLIENT_ID'),
 'client_secret': os.getenv('ZOHOCRM_CLIENT_SECRET')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zoho_crm_connector-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

zoho_crm_connector-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file zoho_crm_connector-0.1.1.tar.gz.

File metadata

  • Download URL: zoho_crm_connector-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for zoho_crm_connector-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc0eba650f753cd1cf4a9431ce3f8f32b08f12a465f3ec7365681c3d2d723360
MD5 38100b9231b51c819ac62ddfda88646b
BLAKE2b-256 89eb6601df24d7eb8564a477df9c89183c3927fc9f62c5b209ddb3288d5150d4

See more details on using hashes here.

File details

Details for the file zoho_crm_connector-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zoho_crm_connector-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for zoho_crm_connector-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d76971eccff23a757fc3703ee8824e3574705e1802bd57f753e8a33ef7acd5f
MD5 3184c96ef9472fbc4fec29a61d754878
BLAKE2b-256 804ded8ce0173719d81331f8f102ba900ccaec033da82a0436e3a5312b1c1a45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page