Victor Baranov
Victor Baranov

Reputation: 155

Microsoft Bing Speech API: Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription

I tried to issue token for voice recognition request as in Microsoft Cognitive Services Bing Speech API tutorial from Postman:

enter image description here

Input URL encoded string is:

grant_type=client_credentials&client_id=[my_key]&client_secret=[my_key]&scope=https%3A%2F%2Fspeech.platform.bing.com

And API responds with error:

{
   "statusCode": 401,
   "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}

What am I doing wrong?

I saw the similar issue, but I don't see update about Bing Speech API in answer.

Thanks in advance.

Upvotes: 2

Views: 3753

Answers (1)

cthrash
cthrash

Reputation: 2973

Looks to me like you have three issues:

  1. The request needs to contain a Ocp-Apim-Subscription-Key header
  2. Your body has an extraneous '=' at the beginning (corrected above)
  3. Your URL appears to be double-encoded, so instead of https:%3A... you have https:%253A... (corrected above)

Upvotes: 4

Related Questions