Using Postman to Authenticate and Call APIs
Fetching an Access Token
You must use an access token to access protected APIs. This guide will show you how to obtain one using OAuth 2.0 Client Credentials.
Step 2: Create a New Request
-
Click on New > Request.
-
Name your request (e.g., "Get Access Token") and save it to a collection.
Step 3: Set the Request Type and URL
-
Change the request type to POST.
-
Set the request URL to:
https://gwg.cloud.utmost.co/api/gwg/supplier/oauth/token
Step 4: Set Authorization Method
-
Go to the Authorization tab in Postman.
-
Select Basic Auth from the dropdown.
-
Enter your Client ID in the Username field.
-
Enter your Client Secret in the Password field.
-
Postman will automatically encode these credentials in Base64 and add them to the request.
Step 5: Set Headers
-
Under the Headers tab, ensure the following key-value pair is present:
Key
Value
Content-Type
application/x-www-form-urlencoded
Calling an Authenticated API
After obtaining the access token, use it in API requests.
Step 1: Create a New Request
-
Click New > Request.
-
Name your request (e.g., "Fetch Data") and save it to a collection.
Step 2: Set the Request Type and URL
-
Change the request type to GET.
-
Enter the API endpoint URL you wish to call.
Troubleshooting
-
Ensure that your Client ID and Client Secret are correct.
-
Verify that Postman is automatically encoding the credentials when using Basic Auth.
-
Check that the access token is not expired before making authenticated requests.
This guide enables suppliers to authenticate and use APIs securely via Postman.