Skill ID: amzn1.ask.skill.c5763345-589c-4e99-a217-721063f9d2b7
StoryWe as humans sometime like to reflect on the past. This skill allows alexa to look in your past facebook posts and speak them to you. It will list up to 3 people that have liked that post.
DemoArchitectural Diagram
- Create a Facebook developer account in order to use their graph API
- Create a new App
- On the App's Settings -> Basics page make sure to add a website platform. (This is necessary so we can enable facebook login for oauth2 verificaton)
- Under Products, select Add Product, then choose Facebook Login
- Make sure to keep the facebook app page open as we will need it later for the oauth2 setup.
- On the aws developer portal, click Add a new skill
- Populate the Skill Information
- Under Interaction Model add the intent schema
{
"intents": [
{
"intent": "AMAZON.PauseIntent"
},
{
"intent": "AMAZON.ResumeIntent"
},
{
"intent": "TellMeAbout",
"slots": [
{
"name": "date",
"type": "AMAZON.DATE"
}
]
}
]
}
- Populate sample Utterances
TellMeAbout Tell me about {date}
TellMeAbout What happened on {date}
TellMeAbout What happened in {date}
- Under configuration select AWS Lambda ARN and populate the lambda function's ID Under North America. (You can find the id in the aws console)
- Under account linking is where we will configure oauth2 with facebook.
client id is your facebook app id
- Head on over back to the facebook developer portal and set up the oauth2 redirect URLs you see on the aws portal Account Linking screen
- Congratulations, your alexa skill can now link to facebook!
Unfortunately we are using the user_posts permission which requires approval from facebook, so for development purposes we will be using the facebook graph explorer's token for requests.
- Get your developer access token with the user_posts permission enabled
- Click Get Token
- Make sure the user_posts permission is checked
- You now have a token! We will use it shortly.
- Run npm install
- Set DEVELOPER_ACCESS_TOKEN to the token you got from the facebook graph API
- Zip up the nodejs application (including the node_modules folder).
- Upload to the lamdbda function
- Click save, once completed the skill will use the updated code.
- Don't forget to enable the skill for your alexa app. The skill will appear in the Your Skills section of the smartphone app.
- It will appear at the bottom
Comments