0

Can we get IP address of my Alexa device using node.js to process some business logic?

I have read some blog but they saying it is personal information so it is not accessible. But some skills available which gives IP address So how it is possible?

How can I get linked account complete profile in alexa skill?

johndoe
  • 4,387
  • 2
  • 25
  • 40
user3256309
  • 29
  • 10

1 Answers1

2

When you setup your Account Linking in developers portal, you have to specify scopes. These scopes represents the list of permissions to request from the skill user. You can provide up to 15 scopes.

Ex: If you are linking Facebook account and if you need to get profile info, then you have to specify the scope: public_profile.

So once a skill user links his/her account, you will get an accessToken in every subsequent request from your skill. You can then validate/use this token to fetch data from their APIs (Resource server). Say, you can get public-profile information from Facebook with the above scope and not anything else. In your case, specify the scope that lets you access profile information from your Resource server.

Read this answer about OAuth2

You won't get IP address, however you can login to your router and check the local IP of the device. If you want to do anything device specific use deviceId in the request JSON.

johndoe
  • 4,387
  • 2
  • 25
  • 40
  • I have not idea if admin have specify any scope or not ? But I am not able to see "accessToken" tag in json generated in akexa skill request. And can you please let me know more details for OAuth2 , I have read the document but totally hanged. Actually i have to fetch From and To from Alexa-settings-traffic to my skill. – user3256309 Aug 01 '18 at 16:14
  • Scopes depends on which OAuth provider you are using. Are you using your own OAuth server? If so, ask the devs. They will tell you which scope to use. Get an idea about OAuth2, try googling, plenty of resources are there. – johndoe Aug 01 '18 at 16:26
  • If you properly link your account then you should get accessToken. There is no API to get traffic FROM or TO address. Currently, the available permissions are Device Address, Lists Read, and Lists Write. You can always ask the user these info from your skill. – johndoe Aug 01 '18 at 16:31
  • I agreed there is not API to get FROM and TO for Traffic update. Than how some skills available which gives traffic update and even Alexa also gives traffic update for the FROM and TO location added for Traffic update in alexa preferences. Than how they getting Traffic update? But I am confused for last line "You can always ask the user these info from your skill" , Can you please clear my doubt little more? – user3256309 Aug 01 '18 at 20:08
  • You can ask user about thier daily commute through the skill like a normal question. And you will get device location details through location/address API. – johndoe Aug 02 '18 at 04:46