[SalesForce] Custom objects not accessible via REST API

I'm currently developing a solution using the DeveloperForce tooling for .NET.

In Salesforce, I have created a custom object CustomObject which has the API name CustomObject__c.

When using the same account to get the list of sobjects from the REST API, the custom object is not returned in this list. When using the ForceClient in the .NET library to add a record of this object type, the response returned is "The requested resource does not exist."

What else do I need to do to create custom objects using the REST API?

Best Answer

Whenever using (directly or indirectly) the Force.com Describe API calls (REST or SOAP), if the running user doesn't have READ access to the object, then the object, standard or custom, won't be returned in the Describe

So, in your case, the ForceClient in the .NET library is connecting to SFDC using some SFDC username. That username has a Profile and optional Permission Sets and if that Profile (Permission Sets) doesn't have access to the Custom Object, then it won't appear in the Describe list. This is surfaced to you as The requested resource doesn't exist

Check your running user's profile to see what objects it can see. Adjust accordingly or use a more expansize profile.

Related Topic