How do I get a subscription key for Microsoft Cognitive Services APIs?

痞子三分冷 提交于 2019-12-24 08:56:53

问题


I'm trying to use the Academic Knowledge Graph / APIs, but haven't found a way to get an API key for it. Initially, I thought the subscription key was one of two "keys" I was given at a certain point, but they didn't work. I'm having trouble finding where those keys are exactly now.

However, I did find a link to the docs: https://dev.labs.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/565d9001ca73072048922d97. Here it shows a URL to get a key:

That URL is: https://dev.labs.cognitive.microsoft.com/developer. Which takes me to an OAuth sign-in page. When I try to sign in, an error is produced:

Upon close inspection, there is an error message in the URL:

error=unauthorized_client&error_description=The+client+does+not+exist.+If+you+are+the+application+developer%2c+configure+a+new+application+through+the+application+management+site+at+https://apps.dev.microsoft.com

This is just the microsoft v2 application registration / management console, where I have visited, where I have an application. Creating a new application does not help. None of the docs, whether specific to Microsoft Knowledge APIs, to Cognitive Services, or more broad ones, seem to help.

There's a few other questions whose titles are pretty much the same as this one, but I think they're all for 2016-2017. Things have changed a lot. You can't create a cognitive service in the Azure portal anymore, as it seems was possible before. There are some Cognitive Services APIs which look approachable here: https://azure.microsoft.com/en-us/try/cognitive-services/my-apis/ (found via those old questions). But not the one I'm interested in, the Academic Knowledge APIs. I've looked around a lot. Are these APIs just not in use anymore, or what?

For reference, I tested out my keys using this suggested code snippet:

curl -v -X GET "https://api.labs.cognitive.microsoft.com/academic/v1.0/interpret?query={string}&complete=0&count=10&offset={number}&timeout={number}&model=latest"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 

回答1:


You can retrieve your Microsoft Cognitive Services Labs keys by going to https://labs.cognitive.microsoft.com/en-us/subscriptions and signing in with your account, Hotmail, LinkedIn, or GitHub.

Looks like the auto generated API reference at the first URL you had included has an incorrect profile link.



来源:https://stackoverflow.com/questions/49763351/how-do-i-get-a-subscription-key-for-microsoft-cognitive-services-apis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!