myfreehaa.blogg.se

How to use apis
How to use apis









Now let’s imagine that you or another user has created hundreds of accounts. Replace the text in the request body with the following text.Let’s specify the account name - Pirate Pete’s Parrot Pellets, in the request body. Thankfully, all the information you need to fix the request is in the error response. Did you get a “Required fields are missing: ”, response?īecause Name is a required field for creating an account, the server didn’t process the request, and you received an error. Under REST, select SObject, and then select POST SObject Create.In the Content-Type row, in the VALUE column, replace application/xml with application/json.Now let’s create an account using the SObject resource and the POST method.įirst, though, let’s change the Content-Type header back to JSON. In the Content-Type row, in the VALUE column, replace application/json with application/xml.Because REST API supports both JSON and XML, let’s change the request header to specify an XML response. The Account metadata is displayed in JSON. Good work, Captain! The Account metadata appears on the screen, and Postman has nicely formatted the response. /describe-An action in this case, a Describe request./:SOBJECT_API_Name-The sObject being actioned in this case, Account./sobjects-Specifies that you’re accessing a resource under the sObject grouping.The double curly quotes indicate that this can be set as a variable. GET-The HTTP method used for this API call.

how to use apis

  • Under Path Variables, in the SOBJECT_API_NAME row, VALUE column, enter Account.īefore you take a look at your query results, let’s take a minute to break down this resource’s URI.
  • how to use apis

    In the main panel, open the Params tab.In Collections, select your fork of the Salesforce APIs Collection.This resource, when combined with the GET method, returns metadata about an object and its fields. You’ll use the SObject Describe resource. When you select a resource from the Salesforce API Collection, the URI builds across the top of the main window. You can make REST API calls to your Trailhead playground using the resources in the Postman app Salesforce Collection REST folder just like you would from any other HTTP interface. You can do this by completing Quick Start: Connect Postman to Salesforce. The first step is to create a new Trailhead Playground, connect it to the Postman app, set up cross-origin resource sharing, and create a fork to the Salesforce API Collection. And Postman is just one of many tools you can use to interact with your Salesforce org through the API. You can make REST requests from any HTTP sender.

    how to use apis

    You’re going to use Postman to make some API calls.











    How to use apis