Understand the Baby Activity Skill API
Alexa.Health API is a set of interfaces that allows you to build baby activity skills for your health and wellness apps and devices. Your users can manage health and wellness data for themselves, their children, and other family members by talking to Alexa. Alexa interprets each user utterance and communicates it to your skill as a request message with a JSON payload that contains an Alexa directive.
In your baby activity skills you can enable Alexa voice interaction so that your users can log activities such as diaper changes, weight, sleep time, nursing time, and bottle feedings.
- Who can develop baby activity skills
- Create a skill
- Alexa.Health interfaces
- Alexa.Health directives
When you use the
Alexa.Health interfaces, the voice interaction model is already built for you. The following examples show some user utterances:
Alexa, track weight of twenty pounds.
Alexa, log a bottle feeding of six ounces for Jane.
Alexa, what is the baby’s weight?
Alexa, start sleep tracking.
Alexa, record sleep for three hours starting at two pm.
Alexa, how long did my baby sleep yesterday?
Alexa, log a formula feeding of three ounces at two pm.
Alexa, how much has my baby eaten today?
Alexa, record a dirty diaper at three pm.
Who can develop baby activity skills
Anyone that stores user identifiers and data related to weight, sleep, diaper changes, nursing, or bottle feeding can build a baby activity skill. For example, if you have a baby tracking app or website, you can integrate your service with Alexa.
You can't use the
Alexa.Health API unless you already store user identifiers and data yourself. Your users create their user profiles in your app or website. Some apps and websites might allow a single user to manage multiple profiles. For example, a user that is a mother can manage a profile for herself and a profile for each of her children. For more information, see User Profiles.
Before you can create a skill, you need to satisfy the following prerequisites:
You must store user identifiers, and data related to weight, sleep, diaper changes, nursing, or bottle feeding.
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 user—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.
You must know JSON, and one of the following languages supported by AWS Lambda: C#, Go, Java, Node.js, Python.
Your system must have OAuth 2.0 enabled and support the authorization-code grant flow type.
You must understand OAuth 2.0 and mutual account linking using a reciprocal access token to use account linking for baby activity skills. For more information, see Configure account linking.
Create a skill
To publish a skill in the Alexa skills store, you create a skill, create an AWS Lambda function to contain your skill code, test the skill, and submit the skill for certification. For baby activity skills, you must also configure account linking and profile reports. For more information, see Steps to Create a Baby Activity Skill.
The following are the available
Alexa.Health interfaces have the following types of directives:
- Data management directives
- The data management directives allow a user to add data. The data management directives are optional if voice interaction is not required. For example, a smart device can add data without a user utterance.
- Timer directives
- The timer directives allow a user to time a session such as a sleep session or a feeding session. Your skill does not have to support the timer directives. If you skill supports one timer directive, it must support all timer directives.
- Query directives
- The query directives allow users to ask questions about their data, and are always required. You can filter and sort the data based on the question that the user asks. For more information, see Filtering and Sorting Query Results.
The following table shows the directives available for each interface.
|Interface||Data management directives||Timer directives||Query directives|
|Sleep||Add||Start, Pause, Resume, Cancel, Stop||Get|
|InfantFeeding||Add||Start, Switch, Pause, Resume, Cancel, Stop||Get|