Brian Peterson
Brian Peterson

Reputation: 2998

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

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:

Subscription Key, where to get it

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:

Unable to complete request

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}" 

Upvotes: 1

Views: 5668

Answers (1)

Dfulcer
Dfulcer

Reputation: 41

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.

Upvotes: 1

Related Questions