You need to sign in to do that
Don't have an account?
agrassi
REST API - Sforce-Limit-Info header not returned
Hi. I'm using SFDC's REST API to access org data. According to the docs (https://www.salesforce.com/us/developer/docs/api_rest/Content/headers_api_usage.htm), each request to the REST API should return a Sforce-Limit-Info header stating the the amount of API requests used, and the amount of remaining requests (on the 24 hours period).
I used curl to perform a test request to the "versions" REST resource, something like this
Anyone has experienced this issue?
I used curl to perform a test request to the "versions" REST resource, something like this
curl https://naxx.salesforce.com/services/data/ -H 'Authorization: Bearer accesstoken'The first request returned the Sforce-Limit-Info header
HTTP/1.1 200 OK Date: Mon, 20 Oct 2014 15:02:23 GMT Set-Cookie: BrowserId=w-h7pI5DQoKtCV3miixgiw;Path=/;Domain=.salesforce.com;Expires=Fri, 19-Dec-2014 15:02:23 GMT Expires: Thu, 01 Jan 1970 00:00:00 GMT Sforce-Limit-Info: api-usage=2/15000 Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunkedThen I performed the same exact request again, but this one didn't return the header.
HTTP/1.1 200 OK Date: Mon, 20 Oct 2014 15:39:14 GMT Set-Cookie: BrowserId=jxsxeMkhRnWczTOVIjCoSA;Path=/;Domain=.salesforce.com;Expires=Fri, 19-Dec-2014 15:39:14 GMT Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunkedSubsequent requests do not return the header either.
Anyone has experienced this issue?
Best Answer chosen by agrassi
agrassi
OK, seems this happens only with the "versions" resource (/). The header is not returned, AND the request doesn't count against the limit. Any other resource, like "Resources by Version" (/vXX.X/), "Limits: (/vXX.X/limits/), "Query" (/vXX.X/query/), etc. will return the header, and the request will count against the API limit.