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
Grainne RyanGrainne Ryan 

Problem accessing API with access token

I know that this question has been asked a lot but none of the proposed solutions helped me.

When I try to access salesforce with the access token I get an error
 "The REST API is not enabled for this organization" "API_DISABLED_FOR_ORG"
I have a developer's edition trial and API is enabled.

I got an access token through curl using "grant_type=password" and then tried to access Salesforce like this:
        curl -v https://eu6.salesforce.com/services/data/v20.0  -H "Authorization: Bearer <access_token>" 

Is this not correct or is there something else I should do?  

Any help would be greatly appreciated.
Thank you
 
Daniel BallingerDaniel Ballinger
Maybe have a quick try with another external tool that makes API calls to see if it is your CURL calls or the org itself.

Try Workbench (https://developer.salesforce.com/page/Workbench)for a start.

You mention have a "developer edition trial" org. That sounds a bit odd. What does it say next to "Organization Edition" if you go Setup > Administration Setup > Company Profile > Company Information (or just search for Company Information under Setup)?
Grainne RyanGrainne Ryan
Thanks for responding.   I can access Salesforce through Workbench without any problems, but since that connects in a different way I still don't know why I can't connect with the access token.

Also I just have the Developer Edition  
 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for access token i hope that will help you
1) http://amitsalesforce.blogspot.in/2016/05/access-token-generation-oauth-20.html
Grainne RyanGrainne Ryan
Thanks, but the link only explains how to get the access token, I have already done that.  I just can't use it.
Naresh YadavNaresh Yadav
Hi Grainne Ryan

Give it a try.

curl https://eu6.salesforce.com/services/data/v20.0 -H "Authorization: Bearer <access_token>" -H "X-PrettyPrint:1"

Peace.
Grainne RyanGrainne Ryan
Hi
Thanks, but I have tried that several times already, each time the error is  "The REST API is not enabled for this organization" "API_DISABLED_FOR_ORG"
Naresh YadavNaresh Yadav
Have you enable API checkbox on the profile.
Grainne RyanGrainne Ryan
Yes I have
Naresh YadavNaresh Yadav
Have you try to connect with another salesforce org.
Grainne RyanGrainne Ryan
No, but I don't see why that would make any difference.  I can connect to my Developer account to get the access code and I can connect with it through workbench. Why would starting a new Developer account change anything?