由于订阅密钥无效(Face API),访问被拒绝 [英] Access denied due to invalid subscription key (Face API)

查看:736
本文介绍了由于订阅密钥无效(Face API),访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Microsoft Face API时遇到问题.以下是我的示例请求:

I am having trouble using Microsoft Face API. Below is my sample request:

curl -v -X POST "https://westus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes=age,gender" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: 1xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxd" --data-ascii "{\"url\":\"http://www.mrbeantvseries.co.uk/bean3.jpg\"}"

我使用了我的认知服务帐户中的订阅ID,但得到的答复如下:

I use the subscription id from my cognitive services account and I got below response:

{
  "error": {
    "code": "Unspecified",
    "message": "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."
  }
}

不确定我是否在那里错过了任何东西.有人可以帮我吗?非常感谢.

Not sure if I've missed out anything there. Can someone help me on this? Very much appreciated.

推荐答案

似乎您输入的是Azure订阅ID? 在Azure门户中,可以在密钥"下找到API密钥,如下所示:

It appears that you've entered your Azure subscription ID instead? In the Azure portal, you can find the API key under 'Keys', shown below:

它将是一个32位的十六进制数字,没有连字符.

It will be a 32-digit hexadecimal number, no hyphens.

这篇关于由于订阅密钥无效(Face API),访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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