2017-02-26 61 views
0

我想打電話給兵文本到語音的Azure服務,但我一直在獲得訪問令牌收到此錯誤,雖然簽約密鑰提供蔚藍的問題令牌API返回的訪問被拒絕,由於缺少訂閱密鑰

function requestAudio(text,lang) 
{ 
    nameLanguage = "Microsoft Server Speech Text to Speech Voice (en-GB, Susan, Apollo)"; 
    language = lang; 
    textToSpeak = text; 
    $.ajax(
    { 
     type: 'POST', 
     url: tokenURL, 
     data: 
     { 
      'Ocp-Apim-Subscription-Key': 'xxxxxxf8cc34d08b646de1bc54c950d' 
     } 
    }).done(function(data) 
    { 
     token = data.access_token; 
     sendAudioRequest(); 
    }); 
} 

正是從小提琴手的錯誤是

{ "statusCode": 401, "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API." } 

和我打電話的網址是

https://api.cognitive.microsoft.com/sts/v1.0/issueToken 

回答