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
gaurav.dgaurav.d 

can we create custom object using REST API?

hi  i m able to create records in salesforce standard objects . but can we create custom object in sales force and insert records in custom object using REST API.

SuperfellSuperfell

Yes, it works exactly the same way.

gaurav.dgaurav.d

will you shere some sample code for create custome object and field  ?please.

SuperfellSuperfell

curl -H "Authorization: OAuth $SID" -H "Content-Type:application/json" --data-binary '{"name":"foo", "customFIeld__c":"bar" }' https://na1.salesforce.com/services/data/v21.0/sobjects/customObject__c

 

See the REST API docs for more details.

gaurav.dgaurav.d

have any java sample to implement this custom  object  creation with rest api?

SuperfellSuperfell

PIck whatever http & json library you want to use, they'll have tons of examples of making POST requests.

 

There are also some examples in earlier posts on the forum, e.g. http://boards.developerforce.com/t5/REST-API-Integration/REST-calls-from-standalone-java-application/m-p/231745#M202

gaurav.dgaurav.d

Thanks Simon.