This sample skill demonstrates how to use Alexa Skill Links to launch skill or custom tasks from anywhere in the web or mobile.
Throughout this sample, you will learn how to create a skill called Task Buddy which implments a number of Custom Tasks, and how to construct Alexa Quick Links with input parameters to access the skill. These Alexa features will enable you to create additional skill functionalities that can be accessed from users anywhere in the web or mobile, and allow you to confidently scale up your user acquisition efforts by providing the tools to properly track marketing attributions.
You can try out a published version of this skill sample using the following pre-constructed links:
- URL for modal skill launch
- URLs for custom task launch:
- PlaySound task (ocean) - you can implement
AudioPlayer
in a custom task that can be launched from Alexa Link. - CountDown task (from 10 to 1)
- SetReminder Task:
scheduledTime
defaults to 20 seconds from when you launch the custom task if the input param is not flagged.scheduledTime
needs to be in theYYYY-MM-DDTHH:mm:ss
format. For instance,2020-06-24T17:50:55
.
- TrackMarketing task - use the special
a2z_ref
param to tag your marketing campaign data for proper attribution. - CheckStatus task
- PlaySound task (ocean) - you can implement
Note: this guide assumes you are using ASK CLI, and requires that you use AWS credentials set up with the appropriate permissions on the computer to which you are using ASK CLI.
1. Clone this repo
$ git clone https://github.com/alexa-labs/skill-sample-nodejs-task-buddy
2. Change directory to the root of the project
$ cd skill-sample-nodejs-task-buddy
3. Associate the project with your Alexa developer and AWS credentials
$ ask configure
4. Deploy the project
$ ask deploy
Note: By default, this would create a new Lambda function using the AWS profile you configure in previous step. Alternatively, if you don't want to provision new resources and instead want to use an existing lambda function, then add the
"endpoint"
object inskill.json
and update"uri"
field with the correct Lambda ARN:
"apis": {
"custom": {
"endpoint": {
"uri": "arn:aws:lambda:us-east-1:XXXXXXXX:function:SKILL-NAME"
},
"tasks": [
{
5. Test Your Custom Task handler
$ ask smapi invoke-skill-end-point -s <skill-id> -g development --endpoint-region=default --skill-request-body file:sample.json --debug
Note: If Custom Tasks are implemented in your skill, please follow the detailed instructions in tests folders in order to test the endpoint with sample task payload.
6. Construct Alexa Quick Links
Modal Skill Launch: https://alexa-skills.amazon.com/apis/custom/skills/<SkillID>/launch
Custom Task Launch: https://alexa-skills.amazon.com/apis/custom/skills/<SkillID>/tasks/<TaskName>/versions/1?param=test
Note: Alexa Quick Links only work with live version of your skill. Please make sure your skill is certified and published before accessing the links.
- Implement Custom Tasks - A great resource for learning custom tasks.
- Alexa Quick Links - Custom Task Launch - Create a Quick Link for Your Custom Task.
- Alexa Quick Links - Skill Launch - Create a Quick Link for Your Custom Skill.
- Test Your Custom Task Handler - To invoke your task handler with sample payload