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
Navya VeeraswamyNavya Veeraswamy 

Rest api client_credentials access token not working

Error: [
    {
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
]

Curl:

curl --location --request POST 'https://xyzsolutions7-dev-ed.develop.my.salesforce.com/services/data/v50.0/sobjects/Opportunity/' \
--header 'Authorization: Bearer 00D5h000008Nj5y!ARkAQDD7JVaKTCHHT.dHTnOIUN680XIfXgzvYr3HqVGz7yu5OZWATT9HqljfV5cHHi355tbTNuOrmomzo3Tm1dUY2S_CGAi.' \
--header 'Content-Type: application/json' \
--header 'Cookie: BrowserId=U-v_xWGkEe64ePPDdIi5iA; CookieConsentPolicy=0:1; LSKey-c$CookieConsentPolicy=0:1' \
--data-raw '{
    "Name": "Sample Opportunity",
    "AccountId": "0015h00001UePQgAAN",
    "StageName": "Prospecting",
    "Amount": 10000,
    "CloseDate": "2023-12-06"
}'

 

While trying to create an opportunity with the client credentials access token am getting the above error , in case of authorization code access token i can able to create an opportunity.

AshwiniAshwini (Salesforce Developers) 
Hi Navya,
You can refer below sample rest api integration scenarios which can help you in resolving the issue.
https://www.gosquared.com/blog/salesforce-rest-api-integration 
https://www.oregon.gov/oha/HPA/OHIT/Documents/Force_REST_API.pdf 
https://salesforce.stackexchange.com/questions/262796/rest-api-the-requested-resource-does-not-exist 
If this information helps, please mark the answer as best. Thank you
Navya VeeraswamyNavya Veeraswamy
https://salesforce.stackexchange.com/questions/262796/rest-api-the-requested-resource-does-not-exist  as per this solution i also checked the version in the url. But no luck