0

getting the following error using curl with salesforce, I'm trying to update a record. Have I formatted this wrong or am I missing something

Many thanks for your help

curl https://##url##/services/data/v53.0/sobjects/Account/##acountID## -H "Authorization: Bearer token" -H "X-PrettyPrint:1" -H "Content-Type: application/json" -d '{"BillingStreet" : "1 Fake Street", "BillingCity" : "London"}' -X PATCH

[ {
  "message" : "Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [line:1, column:2]",
  "errorCode" : "JSON_PARSER_ERROR"
} ]curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 1 Fake Street,
curl: (6) Could not resolve host: BillingCity
curl: (3) Bad URL, colon is first character
curl: (3) [globbing] unmatched close brace/bracket in column 8
6
  • Are you on Windows 10? Which curl --version do you use? Have you tried replacing your single quotes (after "-d") by double quotes and replaced the other double quotes (of the POST data) by the combination of backslash - double quote? Commented Jan 4, 2022 at 13:37
  • Thanks for getting curl 7.55.1 for Windows and curl 7.64.0 on Linux
    – Simon Webb
    Commented Jan 4, 2022 at 15:58
  • like this "{\"PersonEmail\":"\[email protected]\"}" ?
    – Simon Webb
    Commented Jan 4, 2022 at 16:03
  • With the above I get [ { "errorCode" : "METHOD_NOT_ALLOWED", "message" : "HTTP Method 'POST' not allowed. Allowed are HEAD,GET,PATCH,DELETE" } ]
    – Simon Webb
    Commented Jan 4, 2022 at 16:05
  • Your correction is okay. But do you still have -X PATCH in the end? This shouldn't send a POST, it should send a PATCH request. Commented Jan 4, 2022 at 16:16

0

You must log in to answer this question.

Browse other questions tagged .