如何获得Microsoft Cognitive Services API的订阅密钥? [英] How do I get a subscription key for Microsoft Cognitive Services APIs?

查看:167
本文介绍了如何获得Microsoft Cognitive Services API的订阅密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用学术知识图"/API,但是还没有找到获取API密钥的方法.最初,我认为订阅密钥是我在某个时候获得的两个密钥"之一,但它们不起作用.我很难找到这些键现在在哪里.

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.

但是,我确实找到了指向文档的链接: https://dev.labs.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/565d9001ca73072048922d97 .这里显示了获取密钥的URL:

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:

该URL为: https://dev.labs.cognitive.microsoft.com/developer .这将我带到OAuth登录页面.当我尝试登录时,会产生错误:

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:

仔细检查后,URL中出现错误消息:

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

error = unauthorized_client& error_description =该+客户端+不存在+如果+您+是+该应用程序+开发人员%2c +配置+一个+新+应用程序+通过+该+应用程序+管理+ site + at + https://apps.dev.microsoft.com

这只是Microsoft v2应用程序注册/管理控制台,我曾在此访问过该应用程序.创建新的应用程序无济于事.无论是特定于Microsoft Knowledge API,Cognitive Services还是其他更广泛的文档,似乎都没有帮助.

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.

还有一些其他问题的标题与本题大致相同,但我认为它们都适用于2016-2017年.事情发生了很大变化.您再也无法在Azure门户中创建认知服务,这似乎以前是可能的.这里有一些Cognitive Services API,看起来很平易近人: https: //azure.microsoft.com/zh-CN/try/cognitive-services/my-apis/(通过这些旧问题找到).但是我感兴趣的不是学术知识API.我到处逛了很多.这些API不再使用了吗?

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

推荐答案

您可以通过转到

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.

您添加的第一个URL上的自动生成的API参考看起来像是不正确的配置文件链接.

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

这篇关于如何获得Microsoft Cognitive Services API的订阅密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆