I created this script to automate the creation of contacts in Zoho CRM based on a list of cat breeds from the catfact.ninja API. The script calls the /breeds
endpoint to get a list of cat breeds. For each breed with an origin of "Natural", the script creates a contact in Zoho CRM with the following details:
- First Name: The breed name.
- Last Name: The breed name.
- Email: The breed name (with spaces replaced by underscores) followed by
@gmail.com
.
The script is designed to be idempotent, meaning if I run it multiple times, it does not create duplicate contacts in Zoho CRM. I avoided using an external database to ensure this idempotence.
To run this script, you'll need:
- Python 3.x and
pip
installed on your system. - A Zoho CRM account (a free trial is fine).
- The Zoho CRM SDK for Python.
Here are the steps to set up the environment and install the necessary dependencies:
- Clone the repository:
git clone https://github.com/miguelngansop/PYTHON_SCRIPT_ZOHO_SDK.git cd your-repo
- Install the dependencies::
pip install -r requirements.txt
- Set up your Zoho CRM account:::
- Set up your Zoho CRM account:
- Create a Zoho CRM account.
- Configure your API keys and permissions as outlined in the Zoho CRM SDK guide.
Here's how I use the script to create contacts in Zoho CRM from the catfact.ninja API:
- The script calls the /breeds endpoint on catfact.ninja to extract the cat breeds.
- For each breed with an origin of "Natural", the script creates a contact in Zoho CRM.
- The script ensures no duplicate contacts are created through idempotent techniques.
python create_zoho_contacts.py