According to the documentation, the Salesforce REST API returns a Limit Info Header
with each request. So each REST API call gets a Sforce-Limit-Info: api-usage=18/5000
line returned in the response header.
When I make a call to a custom Apex REST API endpoint, this header is not automatically included in the response. The only other way I can find to programmatically determine the limit for an organization is to ping the /limits
REST endpoint. But, according to a SF employee:
This feature is still in pilot mode, and just "might" become generally available with the winter 15 release (november).
So if Sforce-Limit-Info
isn't being returned in the header, and /limits
endpoint isn't in production yet, how can my custom APEX REST endpoint programmatically determine the limits for the authorized organization today, and, how many requests have been made towards those limits?
It doesn't solve the issue, but what would be great/helpful is if Salesforce added a daily_limit
return parameter to the OAuth connection so you at least know the organizations max daily usage at the time you authorize them.