Search code examples
amazon-web-servicesamazon-ec2alexa-skills-kitalexa-voice-service

Amazon Alexa skills set : How to open an app and extract information from it


I am thinking of implementing a project using Alexa Skills Kit.
I couldn't figure out if its possible to open any random app in my mobile and get information from it and alexa to read that information for me.
For ex, is it possible to program alexa to open UBER in my cellphone and read to me how far is the driver ,How much is the fare etc ...?


Solution

  • You cannot open/launch a mobile App from an Alexa skill. The closest you could get would be triggering a push notification.

    However, your sample use case is possible because Alexa can communicate with other APIs and this data is available through the Uber API. See https://developer.uber.com/docs/v1-requests-current

    The user would need to perform the following steps to enable the feature (steps can be performed in either order):

    • When logged into your website/app, the user links their Uber account with an OAuth login, which allows your website to access the Uber API. (Access tokens must be stored on your website NOT in your phone App)
    • Enable your skill in the Alexa app/website and link to the user account on your website by logging into your website with OAuth.

    Unfortunately, two OAuth steps are almost certainly required in this case, one to link Alexa to your website, and another to link your website to Uber, as per https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system, noting this line: "Your service redirects the user to an Amazon-specific URL and passes along the state, access_token, and token_type in the URL fragment." (In theory, Uber could setup their OAuth process to allow directly linking your skill to their account, but they would need to specifically support it.)

    Note that Uber has actually already enabled this type of functionality in their Uber Skill. See https://devblog.uber.com/alexa-your-uber-is-arriving-now/