- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在努力将 Amazon Alexa 与我们当前的系统集成。我必须做的 TL;DR 版本是我应该能够通过 Alexa Skill Management API 以编程方式创建 Alexa 技能。
虽然这很简单,但我在身份验证阶段遇到了障碍(涉及登录亚马逊):
这应该起作用的方式是,您针对 SMAPI 端点发出的每个请求都必须在 Authorization
中包含授权 token 。 HTTP header 。
假设我向 https://api.amazonalexa.com/v0/skills
发出 POST 请求用这个 body :
{
"vendorId":"my-vendor-id",
"skillManifest": {
"publishingInformation": {
"locales": {
"en-US": {
"summary": "This is a sample Alexa skill.",
"examplePhrases": [
"Alexa, open sample skill.",
"Alexa, turn on kitchen lights.",
"Alexa, blink kitchen lights."
],
"keywords": [
"Smart Home",
"Lights",
"Smart Devices"
],
"name": "Sample custom skill name.",
"description": "This skill has basic and advanced smart devices control features."
}
},
"isAvailableWorldwide": false,
"testingInstructions": "1) Say 'Alexa, discover my devices' 2) Say 'Alexa, turn on sample lights'",
"category": "SMART_HOME",
"distributionCountries": [
"US",
"GB"
]
},
"apis": {
"custom": {
"endpoint": {
"uri": <some-aws-lambda-endpoint-uri>"
}
}
},
"manifestVersion": "1.0",
"privacyAndCompliance": {
"allowsPurchases": false,
"locales": {
"en-US": {
"termsOfUseUrl": "http://www.termsofuse.sampleskill.com",
"privacyPolicyUrl": "http://www.myprivacypolicy.sampleskill.com"
}
},
"isExportCompliant": true,
"isChildDirected": false,
"usesPersonalInfo": false
}
}
}
{
"Authorization":"<my-auth-token-that-i-get-from-lwa>"
}
{
"skill_id": "{skill_id}"
}
{
"message": "User has not consented to this operation"
}
['profile profile:user_id alexa::ask:skills:readwrite alexa::ask:skills:test alexa::ask:models:readwrite alexa::ask:skills:test alexa::ask:models:read alexa::ask:skills:read']
Bearer
Authorization
的前缀这样的标题:
{
"Authorization":"Bearer <my-lwa-auth-token>"
}
{
"message": "Token is invalid/expired"
}
最佳答案
从 Node 访问 SMAPI 的最简单方法是使用 SMAPI Node.js SDK,文档可用 here .
为了使用 SMAPI 进行身份验证,您需要执行以下操作:
ask util generate-lwa-tokens --client-id <Client ID> --client-confirmation <Client Secret>
将您的 LWA 客户端 ID 和客户端 key 交换为 LWA 刷新 token . const Alexa = require('ask-smapi-sdk');
// specify the refreshTokenConfig with clientId, clientSecret and refreshToken generated in the previous step
const refreshTokenConfig = {
clientId,
clientSecret,
refreshToken
}
const smapiClient = new Alexa.StandardSmapiClientBuilder()
.withRefreshTokenConfig(refreshTokenConfig)
.client();
然后您就可以通过 SDK 上的函数调用来访问 SMAPI!
关于alexa-skills-kit - 尽管 LWA 授权 token 有效,但 Alexa SMAPI 仍返回 HTTP 4xx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47389444/
如何打开一个大格式的文本文件 [[skill1, skill2, skill3, ...], [skill1, skill4, skill6, ...], ….] 在 Python 中。我尝试过使用
首先,如果我在 alexa 应用程序开发页面上使用模拟器,一切正常,尽管请求看起来有些不同。如果我对我的 Alexa 设备说“询问 appName {x} 和 {y}”,那么我的 Web 服务会被调用
Alexa 技能商店中的某些技能仅使用“Ok Alexa,告诉我一个笑话”或“Ok Alexa,你能复制我吗”之类的句子即可激活,而不使用“Ok Alexa,告诉 [skill]”等标准调用[某事]”
我想开发一个简单的 Alexa 技能,它应该只做一件事。 通过调用它: Alexa, play Radio Luxembourg 它应该播放 http://sc-rtllive.newmedia.lu
我可以将我的 Amazon Alexa Skill 与两个外部服务相关联吗? 我想从他们两个汇总数据,但我需要使用两个不同的访问 token 。 我可以通过使用 Alexa 帐户链接来获取它们吗? 最
我正在开发 Alexa 技能。我想授予我公司的其他人使用该技能的权限,以便对其进行测试。有没有办法做到这一点? 到目前为止,我发现了以下内容: https://developer.amazon.com
我正在使用 Node.js 上的 Alexa Skill Set SDK 构建 Alexa 教学练习技能。我将每个 cooking 步骤保存到数据库中,因此如果技能超时,用户可以重新打开技能并从中断处
我正在使用 Node.js 上的 Alexa Skill Set SDK 构建 Alexa 教学练习技能。我将每个 cooking 步骤保存到数据库中,因此如果技能超时,用户可以重新打开技能并从中断处
我正在阅读 Alexa Skills 的文档,似乎有一个后备意图 https://developer.amazon.com/docs/custom-skills/standard-built-in-i
我正在构建一个需要能够处理问题答案的 Alexa 应用程序。我有一个 SkipIntent具有跳过问题的示例话语的意图。 我想建一个 AnswerIntent可以接受任何答案并根据正确答案处理它们。我
当前行为: 我可以通过开发者控制台访问我的每项 Alexa Skills 的指标,例如“过去 7 天的唯一身份客户总数” 期望的行为: 通过 Amazon 的 ASK CLI 或 SMAPI 执行相同
在 php 中,我们通常使用 name="skills[]"从表单中获取数据作为数组,但如何在 angularjs 中执行此操作?PHP 示例: 我想在 AngularJS 中做同样的事情,但出现语
我想在我的话语中收到一美元。因此,例如,如果我问 Alexa: Send $100.51 to Kroger. (读作,一百美元五十一美分)我想收到值100.51在适当的插槽中。 我试过搜索,我像这样
我正在做其中一个教程(HelloWorld),以使Echo熟练掌握技巧,然后按照指示进行操作。当我使用Service Simulator测试该技能时,我输入了 Alexa, tell Greeter
使用此Amazon-provided library,我正在研究alexa技能,该技能可播放短mp3文件队列。触发音频的代码如下所示: this.response.audioPlayerPlay('R
例如,假设我想在ios应用程序中启动相机以拍照,是否可以利用ASK和iPhone麦克风来理解用户语音命令(“启动相机”)来启动相机并触发ios中的功能? 最佳答案 简短答案:不可以。 长答案:是的,但
我正在使用 python 开发一个 Web 服务,该服务将作为自定义 Alexa Skill 的后端逻辑运行。我正在使用 Flask、flask-ask(Alexa Skill Kit) 和 MySQ
早些时候我遇到了 Alexa 没有将状态更改回空白状态的问题,并且 found out that there is a bug in doing that .为了完全避免这个问题,我决定强制我的技能始
我想拥有一种自定义技能,但是它需要直接访问用户的声音(我们录制的音频的输出)。 Alexa可以/将中继流而不是发送请求调用(启动/意图/ session 结束)吗? 我了解自定义技能可以将mp3作为响
我创建了一个 Amazon Alexa 技能,它具有一个意图 (MyIntent) 和两个自定义槽类型(SlotA 和 SlotB)。意图架构如下所示: { "intents": [ {
我是一名优秀的程序员,十分优秀!