Test APIs using Postman¶
Choreo provides an integrated Postman console to test your APIs. To use this capability, you must integrate your Postman account with Choreo by generating a Postman API key.
- An active Postman account.
- A Postman API key to integrate your Postman account with Choreo. To obtain a Postman API key, refer to the Postman Documentation- Generate a Postman API key. Make a note of the generated key, which you will need to use when you integrate your Postman account with Choreo.
Follow the steps below to test your API via the integrated Postman console in Choreo:
Step 1: Integrate your Postman account with Choreo¶
- Sign in to the Choreo Console.
- In the Component Listing pane, click on the component you want to test.
- Click Test in the left navigation menu and then click Postman to open the integrated Postman console.
- In the Postman pane, go to the third step and click the link to proceed.
- In the API Key field, enter the Postman API key you obtained in the prerequisites section. Choreo validates the key and displays a success icon if it is valid.
- Click Save. This takes you to the Postman pane where you can link a workspace.
Step 2: Link a workspace¶
You can use workspaces to manage your Postman components for different tasks. For more information about workspaces, see Postman Documentation - Using and managing workspaces.
If you have an existing workspace, you can link it to Choreo. Otherwise, follow the steps given below to create a new workspace and link it:
- In the Postman pane, click +Create New in the drop-down list.
- Enter a name and a description for the new workspace.
- Click Create & Link
Now you can add collections to the workspace.
Step 3: Add a collection¶
A collection represents one request, and you can use the collection runner in Postman to run multiple requests in a specified sequence and log the results. For more information about collections, see Postman Documentation - Collection Runner.
To add a collection, follow the steps given below:
If you linked an existing workspace with collections, you can skip this step.
- In the Collections section, click +Add.
- Enter a name and a description for the new collection.
- Click Create.
Now that you have a collection, you can create a request to test your API.
Step 4: Create a request and test your API¶
To create a request and test your API, follow the steps given below:
- Go to the collection you created and click the arrow icon.
- In the Requests section, click +Add.
- Specify a name and description for the request.
- Select an appropriate HTTP method from the Method list.
- Click the Parameters tab and add the necessary parameters for the API method.
- Click the Headers tab and add the required header values.
- Click the Body tab and select the message body type to invoke the API method. Choreo automatically populates the base URL and resource path with the URL to your actual service.
- Click Save. Now you can proceed to test the API via the Postman client.
- Sign in to your Postman account and go to the workspace you linked. You will see the collection and the request you created.
- Go to the request and click Send to test the API.