A deployed API flow consists of a single API and its operations. To test this API, you
can call its operations.
Procedure
To call the API, complete the following steps.
- To view the API definition for the deployed API flow, go to the
Integrations tab of the Manage page and click the tile for
the API flow.
On the Documentation tab, the Overview section
displays the type of API, the protocol, and the base URL for the API endpoint. You can use the
Download OpenAPI Document link to view the OpenAPI document that describes
the API. If you download the API document, it is saved as a YAML file to the default download
location that is configured for your browser. The format of this file name is
APIname-version.yaml; for example,
Customer_API-0.0.1.yaml.
You can view the details of each API operation that was configured in the flows for the imported
API. You can then use these details to test the operation. The operation's description has a tag to
identify which model (defined in the API flow) the operation belongs to.
The following information is displayed for each operation.
- The HTTP request for the operation.
- The header parameters in a collapsible section.
- The body, path, or query parameters with examples, and the schema if relevant, in collapsible
sections. The parameters that you see depend on the operation's settings.
- Languages that can be used when you make the request, and a code sample to call the operation in
the selected language.
- Response codes for the operation, and the response body schema with an example.
You can also click
Definitions and expand the sections to view the schema
definition for each model of the API, and an example with sample values.
- To test any of the API operations, click the operation, then click the Try
it tab.
This example shows how to test the following GET operation to retrieve the details of a customer
contact in
Salesforce by using a unique contact ID. The
Details tab indicates that a Customer ID is mandatory.
- From the Try it tab, specify the ID of an existing Salesforce contact in the CustomerID field.
(You can use the Generate link to generate a sample value, but the test fails
for a GET operation with a generated value because the Customer ID must represent an actual Salesforce contact.)
- Click Send to send the GET request for the API, then check the request
and the response that are displayed.
For the GET example, the
Response
section displays the returned success code (200 OK), the headers, and the contact details from
Salesforce for the specified
CustomerID
value.
- Optional: If appropriate for the operation, check for the expected results in
the target applications.
For the GET example, you can verify that the retrieved details represent a contact that exists in
the
Salesforce instance. The contact ID in the URL for the
Salesforce record is identical to the
CustomerID value that was specified for testing.