Instructions on authenticating and calling a Mule API using postman.
Basics of calling an API
- Make an HTTP POST call to our WU Identity Provider endpoint to receive a JWT (json web token – https://jwt.io/)
- Make another call to the Mule API and pass in the JWT.
- JWT’s expire after 1 hour.
- You can reuse the JWT to access other API’s
Postman is a tool to test API connectivity and results. This is not required, but is useful. It is not a tool to be used as part of an integration.
- Download Postman here: https://www.getpostman.com/
- Sample Postman requests: WUIT-Public.postman_collection.json
- Sample Postman environment: WU-API-Credentials.postman_environment.json
- Install Postman
- Download the 2 sample postman files
- In Postman, click Import
4. Select both of the json sample files you downloaded earlier.
5. You should now have a “WUIT-Public” Collection and a “WU API credentials” environment
6. Click the Cog icon to the right of WU API Credentials
7. Enter your Client ID and Client Secret in the current value fields. Leave the JWT field blank.
Collection Tabs “Body” settings
Be certain to select the x-www-form-urlencoded button
Authenticate and run an API
- Open the “IdM Get JWT” in Postman and run it first. The response will contain the JWT plus other details.
- Open the desired API in Postman, update any query parameters if needed and run it.
Mulesoft Authentication Headers
The following headers are supported by all Mulesoft APIs:
|Authentication||Bearer (IDM issued JWT)||Required. Client used to obtain JWT must be configured in Cloudhub to have access to the API.|
|X-Correlation-ID||Unique string||Optional. This is typically a UUID value which is recorded in both Cloudhub and Splunk logs for easier tracking and troubleshooting.|