How to Analyze API Usage in Salesforce

API usage in Salesforce

 

Understanding your Salesforce API usage is critical for ensuring that your data automation continues to run.

At times you'd want to understand in detail how various apps use the Salesforce API. This article explains how to do that step-by-step.

For more about managing Salesforce API, see our article How to Create a Detailed Salesforce API Usage Report and Manage your API Calls.

API Usage Overview

For API usage overview you could go to Setup -> System Overview to see how many API calls have been made in the last 24 hours. 

Similarly in Reports -> Administrative Reports the "API Usage Last 7 Days" report shows the calls made by user and date for the last 7 days including today. 

API Usage Breakdown by App

For granular API usage by app, Event logging can be used.

Here are the steps to get detailed API usage data:

  1. Log in to Salesforce Workbench: https://workbench.developerforce.com/login.php (this is a Salesforce tool, see screenshots below)
  2. Go to "queries" and then "SOQL Query"SOQL Query Workbench Salesforce
  3. Issue the following query:
    SELECT ApiVersion,CreatedById,CreatedDate,EventType,Id,IsDeleted,LastModifiedById,LastModifiedDate,LogDate,LogFile,LogFileContentType,LogFileFieldNames,LogFileFieldTypes,LogFileLength,SystemModstamp FROM EventLogFileworkbench query
  4. In the "LogFile" column, double-click on the very long string to copy it to the clipboard
  5. Paste that long string into Base64 decoder (like this tool) and click "Decode" to translate the string to plain text csv format
    base64
  6. Copy the plain text to any text editor and save it as log.csv
  7. Open log.csv in Excel or similar, look at the last column named SOURCE_IP, that's the IP of the app that made the API call
  8. Aggregate and analyze API calls by date, time, and SOURCE_IP

When Does Insycle Use Salesforce APIs?

  • APIs are used when you modify data through Insycle, for example, deduplicate, bulk update, import, etc.
  • APIs are used to keep the data in sync between Salesforce <> Insycle. Even when you don't make bulk updates through Insycle, it would still consume APIs based on the number of records that were modified directly in Salesforce by: (i) users (ii) automations (iii) other apps. The sync is efficient and only looks for modified records. That is, if no record was modified, Insycle wouldn't sync any record and wouldn't consume any APIs.

Troubleshooting API Issues

Out of API Calls

When you run out of your allotted API calls on Salesforce, Insycle operations will not be able to run.

If you find that you are running out of APIs, there are a few steps that you can take to fix the situation. 

  • Wait until more APIs become available. the API is per 24 hours. You can monitor how many are available in Settings > API limit
  • Buy more APIs from Salesforce. You can buy Salesforce APIs add-on directly from Salesforce. The price of additional APIs is $25/month per 10K APIs, see more about add-on pricing here.
  • Analyze what is using the APIs. Your APIs may have been drained by a one-off spike from another another app. But if this happens often, follow the process detailed above to evaluate your API usage.

Diagnosing a Sudden Spike in Salesforce API Usage

If you see a sudden sharp increase in Salesforce API usage from Insycle, there are a number of common reasons:

  1. Someone in your company did a big import or bulk update directly in Salesforce. As a result, Insycle had to sync to stay current with the changed records.
  2. Another app that you have installed did a big import or bulk update directly in Salesforce. As a result, Insycle had to sync to stay current with the changed records.
  3. A Salesforce admin introduced a daily script or APEX code that modifies the records automatically every day. Therefore instead of syncing only the net user-modified records, Insycle has to sync potentially the entire database daily. 
  4. Users manually updated many records. Unlikely, but possible. 

Additional Information from Salesforce

About Insycle

Insycle is a complete customer data management solution that makes it simple for companies to manage, automate, and maintain clean customer databases. This allows their teams to execute more efficiently and improve reporting, knowing the data is accurate and formatted properly.

 

Additional Resources

Related Blog Articles

Related Help Articles

Additional Information