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
PolyglotPolyglot 

Organisation Limits REST API

I'm trying to invoke the List Organizations Limits REST API in my developer edition of Salesforce.  I'm getting the following error returned:

[{"message":"limits resource is not enabled","errorCode":"API_DISABLED_FOR_ORG"}]; HTTP Status: 403

The user I am logging in as has the profile System Administrator.  And the System Administrator profile has the Administrative Permission of API Enabled ticked.   I'm using the same login to successfully access the other REST API resources.

Any help is greatly appreciated.
Sonam_SFDCSonam_SFDC
Hi,

Limits is a new REST resource which I understand needs to be enabled in an org for it to be used:
Please go through: http://www.salesforce.com/us/developer/docs/api_rest/Content/resources_limits.htm 
PolyglotPolyglot
"For information on enabling it for your organization, contact salesforce.com" - how do I contact salesforce.com?
Charles Li 9Charles Li 9
Hi there,

I have a probolem about REST API - List Organization Limits. I used the command below and used my account login token.

curl https://ap2.salesforce.com/services/data/v37.0/limits/ -H "Authorization: Bearer hdjrnslalrjJHGNdkskjnUJ" (fake token in this line)

And I got: [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

I guess the Bearer token is not the user security token, it shold be some other token. Am I right? If I am right, please let me know how can I get that token. Thank you very much.
Oscar Scholten @HR2dayOscar Scholten @HR2day
You need to have both the `API enabled` and `View Setup and Configuration` system permissions enabled. When you miss the `API enabled` permission you get the error:
API is disabled for this User
When you miss the `View Setup and Configuration` permission you get the error:
limits resource is not enabled
(at least, that is what I observe when testing against a scratch org using `sfdx force:limits:api:display`)