Find your content:

Search form

You are here

Database.com update with REST api

 
Share

I am trying to use the Database.com REST API to update a record in my database.

Using the REST explorer in my workbench it always gives me an HTTP error (400 bad request) + some HTML that says: We are down for maintenance. Sorry for the inconvenience. We'll be back shortly.

I also get the same error using other REST clients.

The odd thing is that it is only occurring with the update method. GET and Query work perfectly...

What I have in the rest explorer: (I left out my ID numbers)
Methodurl: /services/data/v26.0/sobjects/Album__c/{albumid}

Request headers:
Content-Type: application/json; charset=UTF-8
Accept: application/json

Request body:
{"Name":"Schoppen aas"}

Thanks for any suggestions!


Attribution to: Nielsm

Possible Suggestion/Solution #1

I'll be honest - I have not tried PATCH with workbench. Have you tried using the POST w/ Patch Override? From the docs:

'If you use an HTTP library that doesn't allow overriding or setting an arbitrary HTTP method name, you can send a POST request and provide an override to the HTTP method via the query string parameter _HttpMethod. In the PATCH example, you can replace the PostMethod line with one that doesn't use override:

PostMethod m = new PostMethod(url + "?_HttpMethod=PATCH");'


Attribution to: joshbirk

Possible Suggestion/Solution #2

There was a bug with the database.com inbound proxy where it was incorrectly rejecting PATCH requests. Previously, you had to use the _HttpMethod parameter with a POST request to have your request go through, e.g.

POST /services/data/v26.0/sobjects/Album__c/{albumid}?_HttpMethod=PATCH

Fortunately, this issue is now fixed as of 2012-12-12. PATCH requests may now be used in Database.com organizations.


Attribution to: superfell
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4759

My Block Status

My Block Content