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
Tim STim S 

error 400 using REST API

Hello,

I am using php cURL to access my Salesforce instance using the REST API.  Without any change on my part, it stopped responding on 20th December and has not worked since then.

I have investigated and found that:

1.  The authentication step is working (goes to https://login.salesforce.com)
2.  All other requests to https://myinstance.salesforce.com/services......  fail with error 400
3.  The same requests work in REST Explorer by simply copy/paste the request line

This behaviour looks like Salesforce is rejecting anything coming from my site through the API to myinstance.salesforce.com.

Did any change take place on or about 20th December in the way REST API is called?

If Salesforce has decided that my site or ISP is a bad risk, how can I have that addressed?  I don't expect that it the case because the authentication works.

Merry Christmas to all.

Tim
karthikeyan perumalkarthikeyan perumal
Hello Tim, 

there error is in your JSON or XML part

400 : The request couldn’t be understood, usually because the JSON or XML body contains an error.
if there is any date part in your JSON  for request and response. 
Check your data passing for your request and response.

hope this will help you.

Thanks
karthik
 
@GM@GM
Hi Tim,

Check the http request header and body format with workbench row format before hitting callout so that you can find the difference in the JSON or XML format.

the 400 error comes only when the request is not in the expected format.

Regards,
GM
Akhil YalagondaAkhil Yalagonda

Hi Tim S,

I am facing the same issue.
Have you resolved it? If so, could you tell me what is the resolution?

The above-provided answers do not helping me. The code which is being worked from last 1 year has stopped working by throwing this Exception.