Rado
Rado

Reputation: 346

Salesforce REST API upsert not updating or inserting a record

I am trying to update and insert Contacts using the external ID and patch method with the REST API.

If I try to use an existing record I just get back the record JSON and nothing gets updated. If I use an none existent external ID I get an error:

[
    {
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
]

Authentication works as I can make GET calls and get back the data fine. I am not sure where to go from here. Any leads will be appreciated.

Postman screenshot

Upvotes: 1

Views: 5728

Answers (1)

eyescream
eyescream

Reputation: 19637

Does connecting user have right to see/edit the ExternalID__c and is the field really marked as ext id? What if you'd try to make similar operation in Data Loader or even the REST call in Workbench -> REST API Explorer?

Your request looks OK, you can compare with abomination I made in https://salesforce.stackexchange.com/a/274696/799. It's for upserting to multiple tables in one all-or-nothing operation, without wasting many API calls.

Upvotes: 1

Related Questions