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
Antoine Al HelouAntoine Al Helou 

Problem API Sandbox : getting Token

Hello,

I have a problem with calling the API REST on my Sandbox. The API calling stopped working sundenly. 

The API is working well on my live environment.

I tested the API using SoapUI and i have no problem with the live environment but the same problem with the Sandbox.

I checked every parameter (username, pwd, client id, client secret, the authorisation key and grant type) and always the same error.

I even tried with a different endpoint by replacing the test by the domain i see when i connect to my Sandbox (https://test.salesforce.com).

I also tried with a new fresh Sandbox. But always the same error.

Can you please help ?

Here's the request :
POST https://test.salesforce.com/services/oauth2/token?client_id=XXXXXX&client_secret=XXXXX&username=XXXXX&password=XXXXYYYYY&grant_type=password HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Host: test.salesforce.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


Here's the error i get : 

{
   "error": "unknown_error",
   "error_description": "retry your request"
}

HTTP/1.1 400 Bad Request
Date: Thu, 04 Aug 2016 10:21:00 GMT
Strict-Transport-Security: max-age=10886400; includeSubDomains; preload
Content-Security-Policy-Report-Only: default-src https:; script-src https: 'unsafe-inline' 'unsafe-eval'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /_/ContentDomainCSPNoAuth?type=login
Set-Cookie: BrowserId=tF38uGqgQseAw5QjqMIJaA;Path=/;Domain=.salesforce.com;Expires=Mon, 03-Oct-2016 10:21:00 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache, no-store
X-ReadOnlyMode: false
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked

{"error":"unknown_error","error_description":"retry your request"}
 
Best Answer chosen by Antoine Al Helou
YiqinYiqin
If you are debugging through Fiddler change your protocol to allow TLS 1.1 and TLS 1.2. It might becuase TLS 1.0 was disabled in your sandbox due to recent SalesForce update.

All Answers

YiqinYiqin
If you are debugging through Fiddler change your protocol to allow TLS 1.1 and TLS 1.2. It might becuase TLS 1.0 was disabled in your sandbox due to recent SalesForce update.
This was selected as the best answer
Antoine Al HelouAntoine Al Helou
Many Thanks, It's working !!
YiqinYiqin
Please mark this as Solved. Thanks!