Based on an example from
https://dabblelab.com/
Get the example from and view the video
https://dabblelab.com/templates/2-alexa-remote-api-example-skill
Download the template to a local directory. Since this example is v1 version of Alexa code you need to upgrade to v2
cd to where the template was downloaded. ask deploy fails because the example is v1 in the 2017 example.
$ ask deploy
[Warn]: File /home/allen/Alexa_skills/2-alexa-remote-api-example-skill-master/lambda/ask-resources.json not exists. If this is a skill project managed by v1 ask-cli, please run ‘ask util upgrade-project’ then try the command again.
$ ask util upgrade-project
Template project migration finished.
The ask-resources.json file exists only in the latest version
$ ask deploy
Deploy configuration loaded from ask-resources.json
Deploy project for profile [default]
==================== Deploy Skill Metadata ====================
Skill package deployed successfully.
Skill ID: amzn1.ask.skill.cb3a2bb7-0c55-45e3-a5ff-a40734696ed3
==================== Build Skill Code ====================
added 3 packages, and audited 4 packages in 627ms
found 0 vulnerabilities
Skill code built successfully.
Code for region default built to /home/allen/Alexa_skills/2-alexa-remote-api-example-skill-master/.ask/lambda/custom/build.zip successfully with build flow NodeJsNpmBuildFlow.
==================== Deploy Skill Infrastructure ====================
✔ Deploy Alexa skill infrastructure for region “default”
The api endpoints of skill.json have been updated from the skill infrastructure deploy results.
Skill infrastructures deployed successfully through @ask-cli/lambda-deployer.
==================== Enable Skill ====================
Skill is enabled successfully.
ask deploy uploads the skill from a local directory into Alexa/AWS
A run in Alexa
Access takes place in lambda/index.js to access the API Astronauts currently in space.
The API is http://api.open-notify.org/astros.json
Returns this json text
{“number”: 7, “message”: “success”, “people”: [{“name”: “Mark Vande Hei”, “craft”: “ISS”},
{“name”: “Oleg Novitskiy”, “craft”: “ISS”}, {“name”: “Pyotr Dubrov”, “craft”: “ISS”},
{“name”: “Thomas Pesquet”, “craft”: “ISS”}, {“name”: “Megan McArthur”, “craft”: “ISS”},
{“name”: “Shane Kimbrough”, “craft”: “ISS”}, {“name”: “Akihiko Hoshide”, “craft”: “ISS”}]}
This function reads a list of Astronauts in space from the public API above and formats the text.
Logging can be seen in the Alexa Console page, check the box
Log output