[SalesForce] REST API request for sObject fields and picklist values

I'm able to achieve a rest api request using this url.

na35.visual.force.com/services/data/v38.0/sobjects/custom_object__c/describe

the problem I have is it returns a ton of data. I just need a few fields from the sObject and the picklist values of those fields. The meta data. I'm creating a form to create new records.

How is it done?

Best Answer

You can only describe the entire object, including all fields. Fortunately, you can cache the data and use the If-Modified-Since header to avoid wasting bandwidth between each call. See Get Object Metadata Changes.

Example SObject Describe request

/services/data/v29.0/sobjects/Merchandise__c/describe

Example If-Modified-Since header used with request

If-Modified-Since: Wed, 3 Jul 2013 19:43:31 GMT

Example response body

No response body returned

Example response status code

HTTP/1.1 304 Not Modified
Date: Fri, 12 Jul 2013 05:03:24 GMT
Related Topic