function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
elobdellelobdell 

REST API, how to enable POST, Method Not Allowed error

Some details:

  • We've added some custom objects to our org.
  • We are building a connected app to sync data on these objects between our databases and Salesforce.
  • We're using the User/Password OAuth flow, as there is no "user" to enter their credentails.
  • I've created a user with a password that does not expire, it uses a profile that has API Enabled checked, as well as full CRUD access enabled for the custom objects.
  • I am using this user's credentaials for the connected app we are creating. (.NET Console application...if that helps.)
  • This is all currently being done in a sandbox on developer.force.com, with a developer account, not our enterprise acount and credentials.


I can make all the GET requests I want, but when I try to create a new object via my connected app, I always get  the following:

[{"message":"HTTP Method 'POST' not allowed. Allowed are HEAD,GET","errorCode":"METHOD_NOT_ALLOWED"}]

I have searched high and low for a setting to enable this and the other methods, and I just can't find it.  Do I enable it on each object? Is it on the user, the user's profile, the user's permision set? Is the OAuth flow I'm using prohibitive?

Any help very much appreciated. 

Best Answer chosen by Admin (Salesforce Developers) 
elobdellelobdell

This is resolved. Either there is a mistake in the REST API cheatsheet  or I just misunderstood it.

 

It indicates the Create/POST endpoint is /sobjects

when in fact it is /sobjects/my_custom_object__c

All Answers

elobdellelobdell

This is resolved. Either there is a mistake in the REST API cheatsheet  or I just misunderstood it.

 

It indicates the Create/POST endpoint is /sobjects

when in fact it is /sobjects/my_custom_object__c

This was selected as the best answer
Claus PoulsenClaus Poulsen
Hi,
I can't open the cheatsheet from the link. Is there anywhere I can find more detailed information on this issue? We seem to have the same problem, which is preventing us to export to PDF or to print through a Qlik application running in an iframe in salesforce.
Anoop K SharmaAnoop K Sharma
elobdell already described the issue. It should be full address of the object you're referring to.
For eg. for account it should be like /services/data/v43.0/sobjects/Account