Add Events to Your Skill with SMAPI
When you develop a skill with ASK CLI (Alexa Skills Kit Command-Line Interface), you can modify the skill schema to include event subscriptions that allow you to build richer skill and external app experiences. See Skill Events and List Events.
To add events to an existing skill, follow these instructions. Otherwise, to create a new list skill directly from ASK CLI, see Steps to Create a List Skill.
The following instructions apply to both custom skills and list skills.
A custom skill manifest can include skill events if updated in this manner.
A list skill manifest has two possible formats:
- A skill manifest for a custom skill, including events, plus an additional
householdListfield in the `apis’ object. - A skill manifest that includes a
householdListfield, but nocustomobject in theapisobject, and no interaction model.
Obtain Access to Alexa Skill Management API
Install ASK CLI from npm. See Quick Start Alexa Skills Kit Command Line Interface for installation instructions.
Update Skill Definition to Include Events
After you complete the ASK CLI installation and initialization, you can update your skill definition for any of your existing skills as follows.
- Download your existing skill schema. Run this command:
ask api get-skill –s {skillId} > skill.json
-
Update the
skill.jsonfile to include theeventsobject. See the Skill Manifest formats for each type of supported skill. -
If required by your skill, add the
permissionInfoobject, using the appropriate scopes for your skill, to your skill schema definition manually. Check the format against the appropriate Skill Manifest. -
Update your skill definition. Run this command:
ask api update-skill –s {skillId} –f skill.json
For an example that shows how to include code in your skill service to handle events, see Alexa List Events Project.