Testing Public API with Postman
Postman is a popular API testing tool. We recommend trying out several DirectScale Public API endpoints to get of feel for them before using them in your source code. With this guide, you'll learn how to create a basic call with Postman.
Prerequisites
-
Locate your API Key. You can find your Ocp-Apim-Subscription-Key in your Profile or the Try It section of the API Documentation Site.
-
In the API Docs, note the verb (
GET
,POST
,PUT
,PATCH
, andDELETE
) used. -
Find the Request URL of the call you’d like to make.
-
Note the endpoint's Request Parameters (for example,
{customerId}
). You’ll be inserting the parameter values in the URL as part of the call.
Creating a Request in Postman
Open Postman and create a New Request.
-
Paste the Request URL and enter any Request Parameter values in the URL.
-
Select the proper verb from the dropdown.
-
Under the Headers tab:
- In the KEY column, enter "ocp-apim-subscription-key"
- In the VALUE column, enter your secret API Key.
-
You can leave all other settings to the default.
-
If doing a non-
GET
call, add a JSON request body.- In the API Docs, copy the endpoint's request body.
- In Postman, click the Body tab.
- Click the dropdown and select Raw.
- Select JSON from the language dropdown.
- Paste the request body.
-
Click the Send button.
If successful, the response body will appear.
Updated about 3 years ago