Configure Postman for Media Services REST API calls
This article shows you how to configure Postman so it can be used to call Azure Media Services (AMS) REST APIs. The article shows how to import environment and collection files into Postman. The collection contains grouped definitions of HTTP requests that call Azure Media Services (AMS) REST APIs. The environment file contains variables that are used by the collection.
Before you start developing, review Developing with Media Services v3 APIs.
Create a Media Services account. Make sure to remember the resource group name and the Media Services account name.
Get information needed to access APIs
Install the Postman REST client to execute the REST APIs shown in some of the AMS REST tutorials.
We are using Postman but any REST tool would be suitable. Other alternatives are: Visual Studio Code with the REST plugin or Telerik Fiddler.
Review naming conventions.
Download Postman files
Clone a GitHub repository that contains the Postman collection and environment files.
git clone https://github.com/Azure-Samples/media-services-v3-rest-postman.git
Configure the environment
Open the Postman app.
On the right of the screen, select the Manage environment option.
From the Manage environment dialog, click Import.
Browse to the
Azure Media Service v3 Environment.postman_environment.jsonfile that was downloaded when you cloned
The Azure Media Service v3 Environment environment is added.
Update access variables with values you got from the Access the Media Services API section above.
Double-click on the selected file and enter values that you got by following the accessing API steps.
Close the dialog.
Select the Azure Media Service v3 Environment environment from the dropdown.
Configure the collection
Click Import to import the collection file.
Browse to the
Media Services v3.postman_collection.jsonfile that was downloaded when you cloned
Choose the Media Services v3.postman_collection.json file.
Get Azure AD Token
Before you start manipulating AMS v3 resources you need to get and set Azure AD Token for Service Principal Authentication.
In the left window of the Postman app, select "Step 1: Get AAD Auth token".
Then, select "Get Azure AD Token for Service Principal Authentication".
The following POST operation is sent.
The response comes back with the token and sets the "AccessToken" environment variable to the token value.
- If your application fails with "HTTP 504: Gateway Timeout", make sure that the location variable has not been explicitly set to a value other than the expected location of the Media Services account.
- If you get an "account not found" error, also check to make sure that the location property in the Body JSON message is set to the location that the Media Services account is in.
- Upload files into a Media Services account - REST
- Create filters with Media Services - REST
- Azure Resource Manager based REST API