user3871
user3871

Reputation: 12718

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?

Upvotes: 0

Views: 450

Answers (1)

Jim Rush
Jim Rush

Reputation: 4163

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.

Upvotes: 1

Related Questions