2
votes

I am trying setup media service pipeline via rest services using

https://docs.microsoft.com/en-us/azure/media-services/latest/stream-files-tutorial-with-rest

Section : Encode remote file stream video – REST

We are getting an error at mentioned Step : Create an output asset

As per documentation

https://management.azure.com/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Media/mediaServices/:accountName/assets/:assetName?api-version={{api-version}}

Endpoint that we generaetd: https://management.azure.com/subscriptions/xxxx-xxx-xxx-xxx-xxxxxxxxxx/resourceGroups/xxxxxx_resource_group/providers/Microsoft.Media/mediaServices/xxxxx/assets/xxxxxxxxxx?api-version=2018-08-01

Even if we give api version as 2.1, 2.2 etc …. Then also error is same.

response error :

{

"error": {

    "code": "MissingApiVersionParameter",

    "message": "The api-version query parameter (?api-version=) is required for all requests."

}

}

2

2 Answers

0
votes

In REST v2 the API versions were 2.0 through 2.19, current. But in the REST v3 the API the released version is 2018-07-01. See https://docs.microsoft.com/en-us/rest/api/media/assets/createorupdate.

0
votes

Also, download the Postman Collection for V3 and look at the URLs. Make sure that you are formatting them properly.

https://docs.microsoft.com/en-us/azure/media-services/latest/media-rest-apis-with-postman Use the Postman Console to see the full URL post (open via Alt-CTL-C)

Typical create Asset call would look like: https://management.azure.com/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Media/mediaServices/:accountName/assets/:assetName?api-version={{api-version}}

"/assets?api-version=2018-07-01" is an example