Email Voice Service
After thinking about Voice assistants and how much they help in day to day life for its users the thinking of its potential and what it could do appose to what it can do now. So I thought of creating an voice application that will allow people to have their emails displayed back to them on there smart home assistants with voice telling the user things like who has emailed me today
and show me todays emails
. I started of by reserching the UX of voice, the approach needed to make this application, Why this application would be of relevence to use, Who the target auidence is, how long it would take as well as How to build the application, etc.
Once the reserch was done I used my findings to build my own GMail Alexa Application, I discovered that thier is multipul Alexa Email applications in the US these being Newton , Becky Richas and Alexa has the feature built in nativly as of late 2018 which after this project started. All these are restricted to the US and canot be used in the UK so this skill is made for the UK auidence that currently as of Early 2019 canot read email via Alexa.
Introduction
This is an guide on how to create my own Alexa Application that allows users to have their emails from their Gmail account read out to them.
Guide
This Guide Shows how to build my Alexa Application.
Before you start
There are certian things that are required before you can build this application. The following things are.
- Set up an Google Account if you do not have one already. You do not require an developer account as it's not neccacry as you can just use an link to acess your Google Developer Console
- You will require an AWS Lambda account. It is an Amazon service that hosts the skills code, you will be required to enter an payment method however there are no charges to using this service
- You will require an Amazon account if you wish to use the skill on any of your devices and also will need to use the same email as the Lambda in order to automaticaly have your skilll on your account otherwise you will have to manualy add the user for them to get the skill unless you publish the app publicly.
Step: 1 Google Developer Console Setup:
- Open up https://console.developers.google.com if you do not obtian an account already just agree to the terms & services
- On the navigation menu which is on the left side find & open credentials, once you have done this create an project, you can name it what you please and it is not needed by the skill
- Now close the popup box & go back to the creditail screen where at the top select oauth consent screen where you will enter the information that users will see when asked to confirm the skill. You can put whatever you wish to on there but it is good to know for making your own skills later on & remember to SAVE when you have finished.
- Click on credentials to create credentials and select Oauth client ID
- Under the Application Type select
web application
and give the credential any name you choose. This will be used later on as we shall be able to input the JavaScript Origins and Redirect URLs. At this moment in time click create, once this is done a box will appear with your oauth client information that will be required later on. Keep this open as it will be easist later for when you need to copy over the links that you require.
- Open up the Navigation menu and find the dashboard as you will need to add some spcfic API's these being the following you may use the links below to automatacly find these API's, don't worry about them taking a little longer than expected to load as this is so that it opens up on your project.
Once you have added these they should appear at the bottom of the dashboard. We have finished here for now but you may wish to keep it open for later on.
You are now finished with this step move onto Step 2
Step: 2 Alexa Developer Console Setup
- Open up https://developer.amazon.com
& sigin in to your account or signup if you need to. Once you are logged in press the Alexa button & you will be directed to https://developer.amazon.com/alexa click Create Alexa Skills
and start a Skill. This should give you a list of your skills if this is blank then that's because you havn't created an skill before if not it will show all your skills that you have created. On here you want to click the button to Create Skill
.
- You will be asked to create an skill name for this enter as you please select your languague which should either be English (US) or (UK) and custom for the model, once selected choose Alexa-Hosted as the method, this way you can develop everything within the developer console and do not have to link the skills endpoint to lambda. After you have chosen this create skill
- You should now be on a page which should have somthing called
Interaction Model"
on the left hand side underneath that should have Invocation click on this and it will already have an name which is retreived from the name you gave the skill you can change this to what you wish just remember that when the skill is built to activate the skill you will need to say Alexa ask (Invocation Name)
.
- Click on Intents which you should already have 5 installed these should be Fallback,Cancel,Help,Stop,NaviagetHome. If you have all the following then go to the JSON editor & you shuld be able to
drag or drop a .json file
here you want to drop the InteractionModel File once you have done this click save, there shouldnt be any errors.
- Now go to EndPoint & for Service Endpoint Type select AWS Lambda ARN
- Click save & navigate to account linking
- There should be a box asking
Do you allow users to create an account or link to an existing account with you?
please enable this option
- Under Security Provider Information select the grant type as
Auth Code
and fill the form with the details below
- Authorization URL: https://accounts.google.com/o/oauth2/auth?access_type=offline&response_type=code
- Access Token URL: https://accounts.google.com/o/oauth2/token
- Client ID: This will be found if you return to your creditails in your google developer console
- Client Secret: Will be found underneath creditails in your google developer console
- Client Authentication Scheme: HTTP Basic
- Scope:
- https://www.googleapis.com/auth/gmail.modify
- https://www.googleapis.com/auth/gmail.readonly
- https://www.googleapis.com/auth/drive
- https://mail.google.com/
-
The authorised redirict URLs should be automaticaly filled in becuase this is Alexa-Hosted where as if this was hosted from Lambda you would have to enter the links manualy, the 3 redirect URLs should look like the following.
- https://layla.amazon.co.uk/api/skill/link/[ID number]
- https://pitangui.amazon.com/api/skill/link/[ID number]
- https://alexa.amazon.co.jp/api/skill/link/[ID number]
- Once all this is completed click Save and navigate to the Code page
You are now finished with this step move onto Step 3
Step: 3 Code
- Once you have opend the Code section you should be greated with some preinstalled code that has an HelloIntentHandler, this is code for a basic skill template what we want to do is to delte all the code off this index file and then copy over everything from the index.js file we have into this space.
- Once this is copied over ensure that you save this code and then deploy it, it is importnatnt that you save the code before deploying overwise you will get an error which will state that the code was unsaved and could not be published.
-
Once this has been completed you should be able to move onto distributing the application
You are now finished with this step move onto Step 4
Step: 4 Distribution
- Once you have acessed the distribution page you will be showen a page stating store preview with the details for your application. In the title of the page it will state what region the application is meant for. This may show as for the US region but do not worry as this can be changed very easily in a moment.
Fill in the details with relevent information to the application and then upload the skill icons provided to you if you wish or create your own and import them here.
It is important to note that in order to publish you will require an terms of use and privacy policy, you may use the ones that I have created.
- Privacy Policy URL: https://sites.google.com/view/email-skill-privacy-policy/home
- Terms of Use URL : https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201809740
- Once this is completed click save and continue
- You will be asked a series of questions they should all be answered with No apart from the question asking
Does this Alexa skill collect users' personal information? *
as this one should be Yes as even though you canot see the personal information of other users the application does collect the personal information of the users Google account that is linked
- Once this is completed click save and continue
- Now you will be asked
Who should have access to this skill?
you want to have this as public, you can add people who you would like to beta test the application if you wish and lastly you will be asked Where would you like this skill to be available? *
for this you can put either but I selected to chose an selcted country that being the UK.
Step: 6 Finished Project
Now you have finished building the application all you need to do is acess the Alexa App and link your Google Account and you should be all good to use the application. The application will be listed within the developer section of your skills but if this is not visable this could be becasue you are using an diffrent Amazon account email on your device than what you used when creating the Alexa skill but no worry as you can add yourself as a beta tester in the deployment section of Amazon Developer Console. If you wish to learn more about the code then you can find guides about building for Alexa online and also there are comments within the code to demonstate what each function does
Files
Download all the neccacary files you need
Files Required
These are all the required files you will need to build the application
- Code.Zip
- InteractionModel.json
- index.js
Usful Links
These are the links that you require to build this application
File Links
If you download this zip file, it will contain all the neccacery files that are required to build the application
alexa-gmail.zip
About
This Application and Guide was built by myself Christopher Swinton as part of an university project.