+ Start a Discussion
Andry Ramarijaona 3Andry Ramarijaona 3 

REST API call to Salesforce end up to "503 Service unavailable"

Hi guys,

Does anyone know why a REST API call to salesforce end up to "503 Service unavailable"?

Following is the error message sent by salesforce to our application:
15:18:14,914 WARN [org.springframework.web.client.RestTemplate] (default task-11) GET request for "https://na30.salesforce.com/services/data/v23.0/chatter/users/me" resulted in 503 (Service Unavailable); invoking error handler
15:18:14,929 SEVERE [com.silanis.esl.web.exception.mappers.ThrowableMapper] (default task-11) No error details from Salesforce.: org.springframework.social.UncategorizedApiException: No error details from Salesforce.
at org.springframework.social.salesforce.api.impl.SalesforceErrorHandler.handleUncategorizedError(SalesforceErrorHandler.java:60) [spring-social-salesforce-]
at org.springframework.social.salesforce.api.impl.SalesforceErrorHandler.handleError(SalesforceErrorHandler.java:28) [spring-social-salesforce-]
at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:566) [spring-web-3.2.13.RELEASE.jar:3.2.13.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:524) [spring-web-3.2.13.RELEASE.jar:3.2.13.RELEASE]

Never seen this myself, but havre heard from some developers that the problem automatically goes away after a while. Could be a temporary error, please contact Salesforce support.
Just try copy pasting the REST API url in brower and see what's getting returned.
Andry Ramarijaona 3Andry Ramarijaona 3
Hi Guys,
Thanks for your answer!! we finally found the root cause of the "503 service unavailable".
If you are hitting the Chatter REST API Limits, salesforce backend returns 503 Service Unavailable error code.
Pankaj Singh 196Pankaj Singh 196
Hi Andry, i facing same issue (503 service unavailable) while POSTing data to Mulesoft. Could you suggest. Below are the details.

I am getting below give error while executing code from execute window in Salesforce.

"System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable" 

**Code :** 

    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setHeader('Content-Type', 'application/json;charset=UTF-8');
    // Set the body as a JSON object
    HttpResponse response = http.send(request);
    // Parse the JSON response
    if (response.getStatusCode() != 201) {
        System.debug('The status code returned was not expected: ' +
            response.getStatusCode() + ' ' + response.getStatus());
    } else {

I tried with some other codes as well (having basic auth) but always got same error on this line "**HttpResponse response = http.send(request);**"

I searched over net to resolve it but didn't worked. Kindly help. 
Also help on below points.

1) Do i need to provide signed certificate to Mulesoft.

2) Do i need to put any security certificate in Salesforce received from Mulesoft. Would it be CA signed or Import from Keystore kind.

3) I have already set remote site setting in Salesforce.

4) Proxy opened for all websites.

5) End Point ULR not working in POSTMAN , When checked with Mulesoft they said its because of whitelist issue. There end point URL is perfectly fine.

What is exact way to connect from Salesforce to Mulesoft using REST API and how to POST/GET data.

Thanks Alot!!!

ch Roych Roy
Hi All,
Getting  same error - Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable" issue when calling AWS service from Salesforce. It was working fine initially till Mid June 2020 , but recenly it has stopped working and getting(since last 2 weeks). No code change is done in between either in SF or in AWS end. We are just making simple REST CALLOUT to fetch (GET) the data from AWS. Suddently it has showing the error.

Also when checked with POSTMAN, it returns successful response. It looks specific issue at Salesforce end. Any suggestion please?
Shivani ChaudhariShivani Chaudhari
Hello Everyone,

We are making an Outbound call from Salesforce to the external system and getting below error.

Error: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 503 Service Unavailable

When we try to send the same request from Postman it is working as expected and getting a response. - From the same Org, they were other Outbound calls that are working fine.

We have tested with salesforce, they are saying to whitelist IP ranges, which contains 1,52,000. This is not possible to whitelist this much IPs at third parties end. Please suggest and help to resolve the issue. We have tested it woking fine in Spring 20 version but Summer 20 its not working.