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

Troubleshooting API Issues

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.

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