Azure Video Indexer- Unable to use the api to extract the insight using API call

Umesh Narayanan 0 Reputation points
2025-06-04T20:26:59.8933333+00:00

Hello,

I have created a video indexer account and uploaded the video for indexing. I am able to access in webUI.

However, i would need to use it in the application where i need to extract the insight from the video..
i found below document link to fetch video indexer using API..


[https://api-portal.videoindexer.ai/api-details#api=Operations&operation=Get-Account-Access-Token-With-Permission](https://api-portal.videoindexer.ai/api-details#api=Operations&operation=Get-Account-Access-Token-With-Permission)

Though i configured the url, with below structure, but response returning 404.

What i am expecting is to use the api call to retrieve the content from video indexer..
Kindly help and suggest right approach to achieve this



```yaml
"https://api.videoindexer.ai/Auth/{location}/Accounts/{accountId}/AccessToken[?allowEdit]"
```


```python
import requests

user_token = requests.get(url)

print(user_token)


Azure AI Video Indexer
Azure AI Video Indexer
An Azure video analytics service that uses AI to extract actionable insights from stored videos.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pavankumar Purilla 10,350 Reputation points Microsoft External Staff Moderator
    2025-06-05T04:24:32.6933333+00:00

    Hi Umesh Narayanan,

    A 404 error typically indicates that the requested resource was not found. Please verify that you are correctly replacing {location} and {accountId} in your URL. The {location} must match the region where your Azure Video Indexer account is hosted (e.g., trial, westus2), and {accountId} should be your actual Video Indexer account ID.

    Your URL should follow this structure: https://api.videoindexer.ai/Auth/westus2/Accounts/your_account_id/AccessToken?allowEdit=true.

    Also, ensure that your account has the appropriate permissions to access the API. You will need to first generate an access token by making a request to this URL using your subscription key in the header. Here's a sample Python snippet for retrieving the token:

    import requests
    
    url = "https://api.videoindexer.ai/Auth/{location}/Accounts/{accountId}/AccessToken?allowEdit=true"
    headers = {
        'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
    }
    response = requests.get(url, headers=headers)
    print(response.text)   
    

    Once you obtain the token, you can use it to access video insights by including it as a query parameter in your next API call.
    For more information, please refer to the Azure Video Indexer REST API.


  2. JAYA SHANKAR G S 4,110 Reputation points Microsoft External Staff Moderator
    2025-06-09T11:16:57.12+00:00

    Hello @Umesh Narayanan ,

    To get subscription key go to this developer portal and click on sign in.

    enter image description here

    After clicking on sign in Go To Profile

    enter image description here

    Now you can copy the keys.

    enter image description here

    Next use it in header like below.

    enter image description here

    If above solution helped you please do accept it and give feedback by clicking on yes.

    Thank you


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.