【问题标题】:Alexa app to app account linking in android app , Skill Activation Api gives errorAlexa 应用程序到 Android 应用程序中的应用程序帐户链接,Skill Activation Api 出错
【发布时间】:2023-02-10 23:32:35
【问题描述】:

链接在这里

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 详细信息的页面

在 Allow My Application 获取 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 错误的消息请求错误

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

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

【问题讨论】:

    标签: android amazon-web-services alexa alexa-skills-kit


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-03
      • 1970-01-01
      • 1970-01-01
      • 2019-01-15
      • 1970-01-01
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      相关资源
      最近更新 更多