简体   繁体   中英

Linking in Alexa services into your app

I am creating an Alexa skill using the Alexa Skills Kit, Amazon Echo, and NodeJS Lambda.

I have two questions:

1) How can I access music services from within my skill? Amazon says you can play music through any of these services: 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. 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. Amazon provides the user object within event.session :

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

How can I get user account details of my own signed in user thru 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. You could use the oAuth capability to have the user log into your service. During the login, you could guess location via the IP address or get the browser's location information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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