Alexa 应用程序到 Android 应用程序中的应用程序帐户链接,技能激活 Api 出现错误

问题描述 投票:0回答:2

这是链接

https://developer.amazon.com/en-US/docs/alexa/account-linking/app-to-app-account-linking-starting-from-your-app.html

我在 Android 应用程序中遵循的步骤。

我完成了 LWA 后备 URL 设置,在后备 URL 中我使用了从 Alexa 自定义技能的帐户链接页面收到的客户端 ID。

在浏览器中打开 LWA url 后,页面要求登录亚马逊,之后我可以看到我的技能要求使用“允许”和“取消”按钮访问 lwa 详细信息的页面

允许我的应用程序获取 Auth-Token 后,我从该 Auth-Token 调用令牌 API 并获取访问令牌。

之后我调用下面的激活技能api

POST /v1/users/~current/skills/{skillId}/enablement HTTP/1.1
Host: api.amazonalexa.com, api.eu.amazonalexa.com, 
api.fe.amazonalexa.com
Content-Type: application/json
Authorization: "Bearer {Amazon Access Token}"
{
    "stage": "skill stage",
    "accountLinkRequest": {
    "redirectUri": "https://yourRedirectURI",
    "authCode": "Your user's authorization code from your authorization 
server",
  "type": "AUTH_CODE"
}
}

我使用了如下参数值

Amazon access token - Got that from Amazon token API.
redirectUri = https://pitangui.amazon.com/api/skill/link/XXXXXXXXXXX
authCode = got after perform successful login with amazon.

但是我收到了 400 bad request 错误消息

{"message":"Invalid account linking credentials"}

我无法理解我做错了什么。如果有人有任何建议请帮助我。

android amazon-web-services alexa-skills-kit
2个回答
0
投票

400 错误请求“帐户链接凭据无效”是因为您收到了错误的凭据,因此请确保您使用正确的客户端 ID 和密钥来使用技能激活 API。

我建议您阅读这篇文章。 https://amazon.developer.forums.answerhub.com/articles/240817/app-to-app-account-linking-debugging-tips.html


0
投票

嗨,有人能够解决这个问题吗?

© www.soinside.com 2019 - 2024. All rights reserved.