Test Anywhere APIs with Postman Collection

Test Anywhere APIs with Postman Collection

Tech

 

Testing on Application Programming Interfaces is to send calls to the API, get the output, and record the response. Postman is one of the leading tools in the industry for API testing. Consumers of Anywhere can test and configure the Anywhere API products with our postman collection using the Postman tool.

If you are a consumer who would like to test the Anywhere APIs, you can test the APIs with Postman through calling the APIs and performing basic runtime tests. You can find the postman collection in the “Essential Reads” section of the API product page. MLS Data Services Postman Collection is an example.

 

How to Test an API with Postman

 

Step #1 Download Postman Collection

Download Postman collection from the Essential Read section of API product. For example, MLS Data Service. If you do not have the postman tool installed, refer to download instructions and install Postman.

Open the downloaded collection with the Postman tool.

Step #2 Import Collection

Use the import button to import the downloaded collection in Postman. Please follow below steps.

Import downloaded Postman Collection using Import button in Postman tool. For this,

  • Name the postman collection.
  • Select folder location where you have Postman collection downloaded and select file.
  • If you already have the collection, you can import or replace the existing collection.

img1_Test Anywhere APIs with Postman Collection

Step #3 Get API product credentials for token generation

You can access API Key, Okta Client ID, Okta Client Secret, Scope, and Okta Url from Dashboard - My Apps.

Dashboard My Apps

Step #4 Generate Bearer Token

Now you are ready to generate token. To generate a bearer token to access all the APIs and/or endpoints in the collection, please follow the below steps.

POSTMAN Authorization
  • Enter Okta URL in the postman address bar.
  • On the Authorization tab, select Basic Auth as type.
  • Enter your Okta credentials as Username (Okta Client ID) & Password (Okta Client secret).
POSTMAN Request Body
  • On the Body tab, select x-www-form-urlencoded.
  • Enter the following values:
    • grant_type - client_credentials.
    • scope - Enter Okta Scope.
POSTMAN Response Body
  • Select the Send button.
  • Bearer token is now generated and shown as access_token. You can copy the access_token value for testing APIs in the collection.

Step #5 Configure to Test

Now you have all the necessary information to test the APIs, the last step is to configure the Global variable to test all APIs faster.

6_Test Anywhere APIs with Postman Collection
  • Environmental quick look → Globals → Edit
  • Add three variables and its value
    • token=  Use the generated token
    • baseUrl= Application URL which you can get from the specification page on portal. Example, MLS data service.
    • apiKey= Use apikey from dashboard-Myapps

Step #6 Test the API

You are all set, select any API from the downloaded collection and press send. You can now test the APIs.

7_Test Anywhere APIs with Postman Collection

Reference - https://www.postman.com

Was this helpful? dislike