Retrieve Salesforce Daily API Request Limit

Does anyone know how to retrieve SFDC daily request api limit via SOAP or REST? I don’t see any requirements. Currently, I have to access this information on the company information page. I want to retrieve this information at the code level for batch processing.

Thank you!

We use custom code to solve this problem:

WebService static string GetAPIUsage() {
PageReference pr = new PageReference('/00D20000000HsCQ');//use id of setup page
pr.setRedirect(false);
String result = pr.getContent().toString();
Integer start_index = result.indexOf('API Requests, Last 24 Hours', 1) + 52;
Integer end_index = result.indexOf ('<', start_index);
result = result.substring(start_index, end_index);
result = result.replaceAll(' ', '');
return result; < br />}

Hope it helps.

Greetings, Lucas

Does anyone know how to pass SOAP or REST retrieval SFDC daily request api limit? I don’t see any requirements. Currently, I have to access this information on the company information page. I want to retrieve this information at the code level for batch processing.

Thank you!

We use custom code to solve this problem:

WebService static string GetAPIUsage( ) {
PageReference pr = new PageReference('/00D20000000HsCQ');//use id of setup page
pr.setRedirect(false);
String result = pr.getContent().toString ();
Integer start_index = result.indexOf('API Requests, Last 24 Hours', 1) + 52;
Integer end_index = result.indexOf('<', start_index);
result = result.substring(start_index, end_index);
result = result.replaceAll(' ', '');
return result;
}

Hope It helps.

Regards, Lucas

Leave a Comment

Your email address will not be published.