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
Pooja GargPooja Garg 

How to create Custom Object using REST API services

How to create a new Custom Object using REST API services????

 

 

I am using this url : https://ap1.salesforce.com/services/data/v28.0/sobjects/CustomName

 

n data input as  

 

{

    "Name" : " CustomName"

}

 

then it gives me error as : 

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

 

I am able to do all kind of stuffs like creating new record, updating deleting records in an existing CUSTOM OBJECT..........creating Triggers, Classes for it but not able to create a NEW Custom Object............!!!!

 

 

Please Help....!!

 

Thanks in advance....!!!

Pooja 

Satish_SFDCSatish_SFDC
What is the Server URL you have assigned in the header.
There are two Server URL's, one which works for the data and another for metadata.

Usually the metadata server url is
https://<instance>/services/Soap/m/28.0

Note the 'm' instead of the 'u' in the url..

Hope this helps.

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

Pooja GargPooja Garg

Hi 

   I am not using Soap service URL......................

 

my service URL for REST API is  : https://ap1.salesforce.com/services/data/v28.0/sobjects/ 

 

Where I need to know how to create Custom Object like we can create CustomField or ApexTrigger or ApexClass by using REST API service urls : 

 

 CustomField : https://ap1.salesforce.com/services/data/v28.0/sobjects/CustomField 

 ApexTrigger : https://ap1.salesforce.com/services/data/v28.0/sobjects/ApexTrigger 

 ApexClass : https://ap1.salesforce.com/services/data/v28.0/sobjects/ApexClass

 

but for Creating NEW Custom Object : NOTHING 

 

CustomObject : https://ap1.salesforce.com/services/data/v28.0/sobjects/........................?

 

I looked all around for REST API service URL and procedure to create NEW custom object but everywhere they give me solution for inserting, updating, deleting records for an existing Custom Object..................!!!!

 

Is there any other way to create CUSTOM OBJECT DYNAMICALLY apart from creating Custom Object dynamically in Metadata API in Apex Class.......................!!!!

 

 

Thanks, 

Pooja

Alvin Dutt 6Alvin Dutt 6
Hi Pooja have you found a solution to create custom object with a Rest API ?