我正在尝试开发alexa技能,我想获取用户的电子邮件,然后将其与数据库的电子邮件进行比较。我在网上找到了很多示例,但它们都是用不再支持的SDK v1编写的。
按照说明,在阅读了文档之后,我只写了这段代码,因为它既不能在AWS上运行,也不能在Alexa开发人员的口语测试中运行。我在做什么错?
var accessToken = this.event.context.System.apiAccessToken;
Bearer < ACCESS_TOKEN >
Host: api.amazonalexa.it
Accept: application/json
Authorization: Bearer MQEWY...6fnLok
GET https://api.amazonalexa.com/v2/accounts/~current/settings/Profile.email;
此仓库中有使用客户资料的示例代码:https://github.com/alexa/alexa-cookbook/tree/master/feature-demos/skill-demo-customer-profile搜索以下行:const email = await client.getProfileEmail();