Skip to main content
Trying to create Custom Object using Rest Api getting an Error. Using the below:

Request End point:

https://salesforce.com/services/data/v50.0/tooling/sobjects/CustomObject

Request Body:

{

   "DeveloperName": "AccountAccountRelation__c",

    "Language": "en_US",

    "Description": "A relationship between two accounts, such as between a household and a business account.",

    "SharingModel": "None",

    "CustomHelpId": null,

    "ExternalRepository": null,

    "ExternalName": null

}

Error Response:

{

        "message": "sObject type 'CustomEntityDefinition' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.",

        "errorCode": "INVALID_TYPE",

        "fields": []

    }

Any solution appreciated. Thanks!
1 respuesta
  1. 10 dic 2020, 6:55
    HI Ramesh,

    As per https://salesforce.stackexchange.com/questions/20763/creating-a-custom-object-using-rest-api ,you cannot create custom object using Rest API .You will have to use Metadata API.

    You can try the approach mentioned in https://www.cloras.com/blog/creating-custom-object-and-custom-fields/ to create custom object via Metadata API

    Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
0/9000