8

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=xxx;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=xxx;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.

According to the docs the header should be returned on ALL requests, but this isn't the case. Anyone has experienced this issue? Is there anything I should do to ensure the header is included in the HTTP response? If this is a bug, do you know of any workaround?

1 Answer 1

3

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.

1
  • 1
    This is probably because you don't even need to be authenticated to call the versions resource.
    – metadaddy
    Oct 20, 2014 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .