[SalesForce] salesforce REST Api UPSERT on Salesforce ID

Every attempt I make to UPSERT via REST results in a 405 error which reads:

"errorCode": "METHOD_NOT_ALLOWED",
"message": "HTTP Method 'PATCH' not allowed. Allowed are GET,HEAD,POST"

I've tried to get help here without success: https://stackoverflow.com/questions/17268698/update-records-using-salesforce-rest-api-patch-method-not-working

I am testing this on hurl.it and I have tried these urls:

POST https://XXXX.salesforce.com/services/data/v32.0/sobjects/contact/Id?_HttpMethod=PATCH

PATCH https://XXXX.salesforce.com/services/data/v32.0/sobjects/contact/Id

I am trying to UPSERT based upon a Salesforce ID, not an external lookup.Is it possible to UPSERT based on the Salesforce ID?

Thanks

Best Answer

According to Insert or Update (Upsert) a Record Using an External ID, you should now use POST (as of v37.0). Make sure you're using the 37.0 endpoint (note to visitors from the future: any higher version will work as well, so long as your org supports that version).

Example from the page:

curl https://yourInstance.salesforce.com/services/data/v37.0/sobjects/Account/Id
-H "Authorization: Bearer token"
-H "Content-Type: application/json" -d @newrecord.json -X POST

newrecord.json

{ 
    "Name" : "California Wheat Corporation",
    "Type" : "New Customer"
}

This is new as of Summer '16/v37.0.