Ti ringraziamo per la visita. Questa pagina è per il momento disponibile solo in inglese.

Steps to Create a Baby Activity Skill

Complete the following steps to create a baby activity skill in the developer console, create the AWS Lambda function that contains your skill code, test the skill, and submit it for certification.

Before you create your skill, review the Alexa.Health namespace and decide on the interfaces and directives that your skill will support. For more information, see Understand the Baby Activity Skill API.

Prerequisites

Before you can create your skill, you need to satisfy the following prerequisites:

  • Register as an Amazon developer—To create an Alexa skill, you need an Amazon developer account. If you don’t already have an account, go to https://developer.amazon.com/alexa/console/ask and create an account. You can register for free.

  • Register as an AWS customer—To create an AWS Lambda function, you need an AWS account. If you don’t already have an account, go to https://aws.amazon.com/account/ and create an account. You can register for free.

  • Your system must have OAuth 2.0 enabled and support the authorization-code grant flow type.

Create a skill

To create a new skill

  1. Sign in to the ASK developer console.

  2. Choose Create Skill.

  3. For Skill name, enter the name for your skill as it will appear to customers in the Alexa App. The name must not imply sponsorship by Amazon, or infringe on the copyright, trademark, and publicity rights of a third party.

  4. For Default language, choose the language for your skill.

  5. Select the Baby Activity pre-built model, and then choose Create skill.

  6. Copy the skill ID displayed near the top of the page, and paste it to a convenient location, such as Notepad. For example, amzn1.ask.skill.22649d8f-0451-4b4b-9ed9-bfb6c036f905. You need the skill ID later to configure your AWS Lambda function.

Create an AWS Lambda function

You use AWS Lambda to host the code for your skill. Lambda is a web service that lets you run code in the cloud without managing servers. For more information, see AWS Lambda.

Create an IAM role for AWS Lambda

If you haven't worked with AWS Lambda before, you need to create an Identity and Access Management (IAM) role that enables basic execution. If you already have a role that allows basic execution for Lambda, skip to the next section.

To create an IAM role

  1. Sign in to the IAM console.

  2. On the left side of the page, click Roles, and then click Create role.

  3. Select AWS service.

  4. For Choose the service that will use this role, select Lambda, and then click Next: Permissions.

  5. In the search box next to Filter policies, enter "basic".

  6. Select the check box next to AWSLambdaBasicExecutionRole, then click Next: Tags.

  7. (Optional) Add key-value pairs to tag your role, and then click Next: Review.

  8. For Role name, enter a name for the role. For example, "LambdaRoleForAlexaSkill".

  9. Click Create role.

Create the AWS Lambda function

To create an AWS Lambda function

  1. Sign in to the AWS Lambda console.

  2. In the top right corner of the page, verify that the US East (N. Virginia) region is selected, and if not select it. Currently baby activity skills are supported only in the US.

  3. Click Create a function.

  4. Select Author from scratch, and then do the following:

    1. For Name, enter a name for your Lambda function.

    2. For Runtime, choose the programming language or environment that you prefer for your skill code.

    3. For Role, select Choose an existing role.

    4. For Existing role, choose the name of the role that you created in a previous procedure.

    5. Click Create function.

  5. On the left side of the page, for Add triggers, choose Alexa Skills Kit.

  6. At the bottom of the page, for Skill ID verification, select Enable (recommended).

  7. For Skill ID, enter or paste the skill ID that you copied in a previous procedure.

  8. At the bottom of the page, click Add.

  9. At the top of the page, click Save.

After you create your Lambda function, copy the ARN displayed near the top of the page, and paste it to a convenient location, such as Notepad. For example, arn:aws:lambda:us-east-1:111122223333:function:MySkillLambda.

Configure your skill

After you create your AWS Lambda function, you must configure your skill to communicate with it.

To add your Lambda ARN to your skill configuration

  1. Sign in to the ASK developer console.

  2. Click the name of your skill.

  3. On the left side of the page, click Baby Activity Service Endpoint.

  4. For Default endpoint, enter or paste the Lambda ARN that you copied in a previous procedure.

  5. Click Save.

Write code for your skill

Alexa interprets each customer utterance and communicates it to your skill as a request message with a JSON payload that contains an Alexa directive. Your skill code inspects the request, takes any necessary actions, and then sends a response back to Alexa. Use the documentation for each Alexa.Health interface to see the correct format for your response. For the full list of interfaces, and available directives for each, see Understand the Baby Activity Skill API.

After you create your AWS Lambda function, and configure your skill to communicate it, you can write the code for your skill by using the AWS Lambda console. For more information, see creating functions using the AWS Lambda console editor.

There is sample code for Baby Activity skills and the Alexa.Health API available on GitHub. For more information, see alexa-baby-activity on GitHub.

Configure account linking, reciprocal authentication, and profile reports

You must link Alexa customers that use your skill to your app customers by using account linking and profile reports. For more information, see Account Linking for Baby Activity Skills.

Enable and test your skill

While you're building your skill, you can enable or disable it for testing. You test your skill by using the Alexa Simulator or an Alexa-enabled device. If you use a device, register the device to your Amazon developer account so the skill appears on the device. In addition to other testing, perform the tests in the testing guide.

To enable and test your skill

  1. Sign in to the ASK developer console.

  2. Click the name of your skill.

  3. At the top of the page, click Test.

  4. To enable testing, turn on the Test is disabled for this skill toggle.

  5. Find your skill in the Alexa app, and then enable it.

  6. Give Alexa commands by using the utterances that your skill supports. Make sure to test both expected behavior and error conditions.

When you are satisfied with the functionality of your skill, you can submit it for certification.

Submit your skill for certification

The final step to create your baby activity skill is submitting the skill for certification. Before you submit your skill for certification, review the testing guide.

To submit your skill for certification

  1. Sign in to the ASK developer console.

  2. On the Certification page, follow the directions.

After your skill is certified and published, it appears in the Alexa skills store for Alexa customers to discover.