Kaizen 158 - How to effectively handle API calls to optimize API credits?

Kaizen 158 - How to effectively handle API calls to optimize API credits?

Hello everyone!

Welcome back to another post in the Kaizen series!

In this post, we will discuss a few strategies to handle API calls effectively and optimize your API credits.

As you all know, your CRM edition comes with a set number of credits(this varies based on the number of licenses purchased) and all API calls consume these API credits. Refer to our API limits page for more information on the credit system.

Businesses use different processes for different needs, so they use different APIs. Here are a few strategies that can help you optimize your API usage and save up on credits while still maintaining efficient operations.

  1. Understand API Credit Consumption
  2. Optimize API Calls - Batch and bulk
  3. Implement Caching Mechanisms
  4. Minimize Redundant Calls
  5. Analyze Usage - track credit usage, set alerts
  6. Increase Credits to fit your needs

1. Understand API Credit Consumption

The primary step to optimize your usage is to understand it and know the credit system. Each API call consumes a specific number of credits based on its type. For example, a standard Get Users API call costs 1 credit, while a more complex operation, like converting a lead, consumes 5 credits.
Refer to the credit consumption table provided on the API Limits page to plan your usage efficiently.

2. Optimize API Calls

Batch Requests

Whenever possible, batch requests to combine multiple operations into a single API call. For instance, consider that you want to insert or update 20 records. Insert/Update Records API consumes 1 credit for every 10 records. So, instead of making the API call 20 times and spending 20 credits, you can insert or update all 20 records in a single API and spend only 2 credits.
You can also use Composite API to combine up to 5 API calls as sub-requests in one composite request based on your use case.

Bulk APIs

For large data sets involving thousands of records, leverage bulk APIs that can process multiple records in a single request. This approach not only saves credits but also enhances performance by reducing the number of individual requests sent to the server.
Furthermore, these APIs support callback by which you can reduce polling(thereby saving credits) and get near real-time notification of the bulk job.
Refer to our Kaizen post on When to use Get Records, Search Records, COQL and Bulk Read APIs? to decide which API will suit best for a given scenario.

3. Implement Caching Mechanisms

Store frequently accessed metadata locally or in a temporary cache. This allows you to get the data from the cache instead of making multiple calls to get the same information. Caching metadata of modules and fields would be a game changer as these are one of the most frequently accessed data.

4. Minimize Redundant Calls

Upsert Records API instead of Insert/Update Records

Use the upsert records API while creating records. If you have enabled duplicate check based on unique fields or display label, this API checks if there are existing records, and updates or inserts, accordingly. This helps you save up on credits instead of searching for records and then inserting or updating them.

Use Webhooks

Use webhooks to receive notifications about changes in data instead of polling. This reduces the need for frequent API calls to check for updates.
For example, when you use bulk APIs, they support both polling and callback. Use callback to get notified about the status of the job instead of using the API to poll for an update.

Similarly, you can use the Notification API to receive near real-time notification about changes in data. For instance, when you want to know whenever a deal is created, subscribe for the create action on the Deals module using the Notification API. This helps you avoid making repeated Get Records API calls to check for new records.
Instead of polling for updates, utilize webhooks to receive near real-time notifications about changes in data. This reduces the need for frequent API calls to check for updates. Notification APIs allow you to get near real-time notifications on data in CRM, while the Bulk APIs support both polling and callback op.

5. Monitor and Analyze Usage

Track API Credit Usage

Regularly monitor your API credit consumption through the API dashboard. The Dashboard gives you a comprehensive view of your credits, the usage pattern, consumption by modules, functions, integration tasks, etc. Understanding these patterns can help identify areas where you can avoid spending credits and optimize further.

Set Alerts for High Usage

Zoho CRM alerts the super admin of the org via an email whenever the API usage reaches 80, 90, or 100% of the available credits. Configure alerts based on your critical threshold limits to avoid unexpected disruptions. Refer to this page to learn how you can customize these alerts.

6. Increase Credits Wisely

Estimate Requirement Accurately

If you find that your organization consistently exceeds its credit limits, consider increasing your API credits from the API dashboard conveniently. Be mindful about add-on credits based on usage data in the past. Zoho CRM uses the pay-as-you-go model for add-on credits, so you only pay for what you use.


We hope that these simple strategies will help you optimize your API calls in Zoho CRM, effectively manage your API credits, and reduce unnecessary costs while maintaining efficient operations.
Let us know your thoughts in the comment section. Write to us at support@zohocrm.com if you have any questions.
See you next week!
Cheers!

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方