[SalesForce] How to identify API calls from a specific application

We use a single Salesforce account as our API/integration account. As an example, we have 3 web applications that make REST API calls to Salesforce using this single account.

I would like to have each application identify themselves when they make an API call so I can better understand how many API calls each application is making.

The administrative report that Salesforce provides called "API Calls Made Within Last 7 Days" shows all the API calls by user, client id and day of the week.

How can I specify a client id with each of my API requests? Some people have mentioned looking at the Setup/Create/Apps section. However, there must be another way of specifying a client name because I can see a client name specified in the report that is not setup in the Apps section.

Best Answer

Another alternative if each of the external applications has their own IP address is to use the Event Logs API and the RestApi Event Type. Note that this would be a paid feature outside a developer edition org.

Part of the RestApi report is the CLIENT_IP column. If each external application has a distinct IP address then they would be easy to identify in the CSV report.

enter image description here


There is also the USER_AGENT column, so you might be able to use a different user agent with each request. I'll try and find out how to decode/control the reported numeric codes.

Update: It would be extremely hacky, but you could use valid browser user agent strings to produce identifiable USER_AGENT values in the event log. E.g. Have one external app send in the Chrome user agent string with the REST API request. Then either vary the version it identifies as in another external app, or have it identify as a completely different browser. There is hope that a pilot program will add support for custom user agent strings.

Related Topic