I am running version 7.11.15 and I am able to query via the v8 JSON API but when I try to update I get a 400 error. I thought it had something to do with the spacing or line breaks but I removed them all and that didn’t help.
{
"errors": {
"status": 400,
"title": null,
"detail": "The option \"{\n\"data\":_{\"type\":_\"Accounts\",\"id\":_\"7121ba98-d43e-3f77-2d28-5f688dfcb6f4\",\"attributes\":_{\"name\":_\"test_account_B\"}}\n}\" does not exist. Defined options are: \"data\"."
}
}
This was resolved when I changed the Content-type header to application/json. I had been trying to use application/x-www-form-urlencode because that was the only way I could get the authentication to work.
do you have an example of a working curl patch function? i am able to run GEt request and pull info, but am not understanding the patch usage and arrays with curl.
You should be able to modify the “module_name” and various fields used, to update as you wish
As it is a PATCH request you’d like to do, you will need to include the “id” of the record you would like to update like so:
(This will update the contact record in my CRM with ID: 4855d4e4-576d-ba81-b192-600af0d71a0b, to set its name to “John UpdateMe”, feel free to change this)
Let me know if you have any trouble.
I’m not particularly experienced with cURL, but i’ll have a look!