Salesforce Developer Apis Rest

salesforce-developer-apis

// Salesforce - Developer - APIs - REST:

The first step is to log in to Workbench:

1. Log in to your Trailhead DE org and navigate to Workbench (https://workbench.developerforce.com/login.php).
2. For Environment, select Production.
3. For API Version, select the highest available number.
4. Make sure that you select I agree to the terms of service.
5. Click Login with Salesforce.

You can make REST API calls from the REST explorer just like you would from any 
other HTTP interface. The text in the text box represents a resource URI. For 
convenience, the top-level domain is omitted from the displayed URI. For example, 
the full URI of the resource that’s prepopulated in the URI text box is 
https://foo.my.salesforce.com/services/data/v36.0.

To use the Rest Explorer feature of the Workbench, select "Rest Explorer" from 
the "Jump to" drop-down, and click "Select".  We can use the radio buttons at 
the top to specify the HTTP method.  

We can click on the "Headers" button to change or add HTTP headers.

We’ll try describing the Account object. Replace the existing text in the URI 
text box with /services/data/vXX.0/sobjects/account/describe, where XX maps to 
the API version you’re using.

To change the request header to specify an XML response. Next to the HTTP 
methods, click Headers. For the Accept header value, replace application/json 
with application/xml.

To use the Rest Explorer feature of the Workbench, change the URL to something 
like:

/services/data/vXX.0/query/?
  q=SELECT+Name+From+Account+WHERE+ShippingCity='San+Francisco'

To create a record, change the URL to something like:

/services/data/v37.0/sobjects/account

and click on the "POST" radio button, and provide:

{
  "Name": "Blackbeards Grog Emporium",
  "ShippingCity": "San Francisco"
}

in the "Request Body" text box, and click Execute.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License