简体   繁体   English

将Alexa服务链接到您的应用程序

[英]Linking in Alexa services into your app

I am creating an Alexa skill using the Alexa Skills Kit, Amazon Echo, and NodeJS Lambda. 我正在使用Alexa技能套件,Amazon Echo和NodeJS Lambda创建Alexa技能。

I have two questions: 我有两个问题:

1) How can I access music services from within my skill? 1)我如何才能发挥自己的音乐服务? Amazon says you can play music through any of these services: https://www.amazon.com/gp/help/customer/display.html?nodeId=201549700 亚马逊表示您可以通过以下任何一种服务播放音乐: https : //www.amazon.com/gp/help/customer/display.html?nodeId=201549700

I want to make my skill be able to start/stop a playlist using one of these services, but I don't think it's possible to access an outside service from Alexa unless I go thru that service's API. 我想让我的技能能够使用这些服务之一来启动/停止播放列表,但是除非我使用该服务的API,否则我认为无法从Alexa访问外部服务。 Is that correct? 那是对的吗?

2) Getting a user's Amazon profile (user location, etc...): I want to send promotions/coupons to a user based on their location. 2)获取用户的Amazon个人资料(用户位置等):我想根据用户的位置向其发送促销/优惠券。 Amazon provides the user object within event.session : Amazon在event.session提供了user对象:

exports.handler = function (event, context, callback) {
    try {
        else if (event.request.type === "IntentRequest") {
            console.log('LAUNCH', event.session.user);

But console log only shows the amazon user ID: amzn1.echo-sdk-account.HHHZGGGHZGZHGHGHGHGAKIOOAOHJZHZHFGA 但是控制台日志仅显示亚马逊用户ID: amzn1.echo-sdk-account.HHHZGGGHZGZHGHGHGHGAKIOOAOHJZHZHFGA

How can I get user account details of my own signed in user thru Alexa? 如何通过Alexa获得我自己登录用户的用户帐户详细信息?

For #1, Amazon hasn't exposed any of the music controls nor streaming features to skill writers. 对于第一名,亚马逊没有向技能作家公开任何音乐控件或流媒体功能。

For #2, they don't expose account profile information via the skill. 对于#2,他们不会通过技能公开帐户资料信息。 You could use the oAuth capability to have the user log into your service. 您可以使用oAuth功能使用户登录到您的服务。 During the login, you could guess location via the IP address or get the browser's location information. 登录期间,您可以通过IP地址猜测位置或获取浏览器的位置信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM