API Callout limit
AnsweredHow can I check API callout limit my service account currently used for this month?
-
Official comment
If you can access the admin console reporting section, you should be able to follow these instructions!
Alex
Comment actions -
Hi Alex,
here is result
I also tried method 1 and method 2 in June, but csv result show only api call count for method 2 result.
method 2 is using Named Credential and Salesforce Auth Provider with Box App (App Name: Files Connect).
method 1 is using toolkit to send request so it doesn't count?Method 1
public static String GetFileInfoByToolkit(String fileId) {
// Instantiate the Toolkit object
box.Toolkit toolkit = new box.Toolkit();
// Specify the Box API endpoint to call
String endpoint = 'https://api.box.com/2.0/files/'+ fileId +'/';
// Create a new HttpRequest object and set appropriate values
HttpRequest request = new HttpRequest();
request.setMethod('GET');
request.setEndpoint(endpoint);
request.setHeader('content-type', 'application/json');
// Send the HttpRequest through the generic Toolkit method, which will handle the authentication details
HttpResponse response = toolkit.sendRequest(request);
System.debug('response body '+ response.getBody());
return null;
}Method 2
public static String GetFileInfoByNamedCredential(String fileId){
// Specify the Box API endpoint to call (using named credential)
String endpoint = 'callout:custBox/2.0/files/'+ fileId +'/';
// Create a new HttpRequest object and set appropriate values
HttpRequest request = new HttpRequest();
request.setMethod('GET');
request.setEndpoint(endpoint);
request.setHeader('content-type', 'application/json');
Http http = new Http();
HttpResponse response = http.send(request);
SYstem.debug('response body '+ response.getBody());
return null;
}Thanks
-
Sorry to send you on a little chase! When you use a custom application (like your method 2 above), the platform report will show the activity. When you use the developer toolkit, it does not show up on that report it turns out. I forgot that the SFDC process doesn't require you to set up an application.
Taking a step back, when are you curious about the number of API calls? Are you seeing an issue that is making you ask about this?
-
Thanks Alex,
As I think toolkit API call not show in report!
Yes, we have to migrate existing files to Box from Salesforce. There are over 2 millions files so we have to move in daily apex scheduled batch in which Toolkit method used. That is why I want to know daily api call outs.
Please sign in to leave a comment.
Comments
11 comments