function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
agrassiagrassi 

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
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: chunked
Then 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: chunked
Subsequent requests do not return the header either.

Anyone has experienced this issue?
 
Best Answer chosen by agrassi
agrassiagrassi
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.