アクセスいただきありがとうございます。こちらのページは現在英語のみのご用意となっております。順次日本語化を進めてまいりますので、ご理解のほどよろしくお願いいたします。

Alexa.Health.InfantFeeding Interface

The Alexa.Health.InfantFeeding interface describes messages that you can use to develop Alexa skills for your apps and devices that track infant feeding. You can develop your skill as a stand-alone skill, or you can integrate it with a smart home device, such as a smart bottle. For an overview of the Alexa.Health interfaces, see Understand the Baby Activity Skill API.

For the list of locales that are supported for the InfantFeeding interface, see List of Capability Interfaces and Supported Locales.

Utterances

When you use the Alexa.Health.InfantFeeding interface, the voice interaction model is already built for you. The following examples show some customer utterances:

Alexa, log a bottle feeding.
Alexa, log a formula feeding.
Alexa, log a formula feeding of three ounces at two pm.
Alexa, log a nursing.
Alexa, record a nursing from the left for ten minutes.
Alexa, how long have I nursed the baby today?
Alexa, how long was my last nursing?

After the customer says one of these utterances, Alexa sends a corresponding directive to your skill. You identify which directives you support, and for which customers, in the user profile report. You handle the directive and send a response event back to Alexa.

Before you submit your skill for certification, verify that you correctly handle the utterances in the testing guide.

User profile report

When a customer enables your Alexa skill, post a profile report message to Alexa. Your customers create their profiles in your app, and you create an identifier to track them in your app. Send the same identifier to Alexa as profileId in the profile report. If a customer adds, updates, or deletes a profile in your app, post a new profile report message to Alexa.

Identify the directives that your skill supports for each profile as supportedOperations in the profile report. The Get directive is always required. Requirements for other directives are specified in the Directives section.

You can send multiple profiles and multiple capabilities in the profile report. For more information, see User Profiles.

User profile report example

{
  "report": {
    "messageId": "<message id>",
    "profiles": [
      {
        "profileId": "<profile id>",
        "name": {
          "firstName": "Baby",
          "lastName": "Doe",
          "nickNames": ["Baby", "Junior"]
        },
        "capabilities": [
          {
            "name": "Alexa.Health.InfantFeeding",
            "type": "AlexaInterface",
            "version": "1",
            "supportedOperations": ["Add", "Get", "Start", "Switch", "Pause", "Resume", "Cancel", "Stop"]
          }
        ]
      }
    ]
  }
}

The feedingMeasurement object

The Alexa.Health.InfantFeeding interface uses the feedingMeasurement object as the primary data object. The feedingMeasurement object contains a bottleFeeding object or a breastFeeding object depending on the type of feeding.

feedingMeasurement details

Field Description Type Required
type The type of feeding; NURSING or BOTTLE. String Yes
startTime The time that feeding started, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Yes
bottleFeeding The details of the bottle feeding to add. A bottleFeeding object as described following. Yes if bottle feeding.
breastFeeding The details of the breast feeding to add. A breastFeeding object as described following. Yes if breastfeeding.

bottleFeeding details

Field Description Type Required
quantity The amount of liquid that was fed to the baby. A quantity object. One of quantity or duration is required.
duration The duration of the feeding. A duration string. One of quantity or duration is required.
contentType The contents of the bottle; FORMULA or BREAST_MILK. String Yes

breastFeeding details

Field Description Type Required
type The type of breastfeeding; SINGLE_SIDE or BOTH_SIDES. String Yes
singleSideBreastFeeding The details for single-sided nursing. A singleSideBreastFeeding object as described following. Yes if single-sided feeding.
dualSideBreastFeeding The details for a dual-sided nursing. A dualSideBreastFeeding object as described following. Yes if dual-sided feeding.

singleSideBreastFeeding details

Field Description Type Required
nursingSide The nursing side; LEFT or RIGHT. String Yes
duration The duration of the feeding. A duration string. Yes

dualSideBreastFeeding details

Field Description Type Required
leftDuration The duration of the feeding from the left side. A duration string. Yes
rightDuration The duration of the feeding from the right side. A duration string. Yes
totalDuration The total duration of the feeding. A duration string. Yes
lastSide The last nursing side; LEFT or RIGHT. String Yes

feedingMeasurement example with bottle feeding

{
  "feedingMeasurement": {
      "type": "BOTTLE",
      "startTime": "2018-03-14T07:30Z",
      "bottleFeeding": {
        "quantity": {
          "value": "5",
          "unit": "US_FLUID_OUNCE"
        },
        "contentType": "FORMULA"
      }
  }
}

feedingMeasurement example with breastfeeding

{
  "feedingMeasurement": {
      "type": "NURSING",
      "startTime": "2018-03-14T08:30Z",
      "breastFeeding": {
        "type": "BOTH_SIDES",
        "dualSideBreastFeeding": {
          "leftDuration": "PT5M",
          "rightDuration": "PT5M",
          "totalDuration": "PT10M",
          "lastSide": "LEFT"
        }
      }
    }
}

Directives

Add directive

Support the Add directive so that customers can log a feeding session. The Add directive is optional.

The following example shows a customer utterance:

Alexa, log a bottle feeding.

Add directive payload details

Field Description Type Required
feedingMeasurement The feeding measurement to add. A feedingMeasurement object. Yes

Add directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Add",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile to associate with the feeding session>"
    },
    "payload": {
      "feedingMeasurement": {
        "type": "BOTTLE",
        "startTime": "2018-03-14T06:30Z",
        "bottleFeeding": {
          "duration": "PT5M",
          "contentType": "FORMULA"
        }
      }
    }
  }
}

Add response event

If you handle an Add directive successfully, respond with an AddResponse event.

AddResponse event payload details

Field Description Type Required
entryId Your identifier for the record that you added. String Yes

AddResponse event example

{
  "event": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "AddResponse",
      "messageId": "<message id>",
      "payloadVersion": "1",
    },
    "payload": {
      "entryId": "<entry id>"
    }
  }
}

Add directive error handling

If you can't handle an Add directive successfully, respond with an Alexa.Health.ErrorResponse event.

Start directive

Support the Start directive so that customers can begin timing a feeding session. You can also start a timer retroactively. The Start directive is not required.

The following examples show customer utterances:

Alexa, start the feeding for Jane.
Alexa, start the feeding for Jane starting one minute ago.

Start directive payload details

Field Description Type Required
startTime The time that feeding started, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Yes
type The type of feeding; NURSING or BOTTLE. String Yes
bottleContent The contents of the bottle; FORMULA or BREAST_MILK. String Yes if bottle feeding.
nursingStartSide The side where the baby is nursing; LEFT or RIGHT. String Yes if breastfeeding.

Start directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Start",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile to associate with the feeding session>"
    },
    "payload": {
      "startTime": "2018-03-14T05:30Z",
      "type": "NURSING",
      "nursingStartSide": "LEFT"
    }
  }
}

Start response event

If you handle a Start directive successfully, respond with a standard Alexa.Response event. For more information, see Alexa.Response Interface.

Start directive error handling

If you can't handle a Start directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the TIMER_ALREADY_RUNNING error type if the timer is already running.

Switch directive

Support the Switch directive so that customers can log switching sides during dual-sided nursing. The Switch directive is not required, and is not allowed, unless the Start directive is supported.

The following example shows a customer utterance:

Alexa, switch sides.

Switch directive payload details

Field Description Type Required
switchTime The time that feeding switched sides, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Yes

Switch directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Switch",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile associated with the feeding session>"
    },
    "payload": {
      "switchTime": "2018-03-14T05:35Z"
    }
  }
}

Switch response event

If you handle a Switch directive successfully, respond with a SwitchResponse event.

SwitchResponse event payload details

Field Description Type Required
currentNursingSide The side where the baby is currently nursing; LEFT or RIGHT. String Yes

SwitchResponse event example

{
  "event": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "SwitchResponse",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "payload": {
      "currentNursingSide": "RIGHT"
    }
  }
}

Switch directive error handling

If you can't handle a Switch directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the TIMER_NOT_RUNNING or TIMER_ALREADY_PAUSED error type if appropriate.

Pause directive

Support the Pause directive so that customers can pause a feeding timer. You can pause a feeding timer retroactively. The Pause directive is not required, and is not allowed, unless the Start directive is supported.

The following example shows a customer utterance:

Alexa, pause feeding.

Pause directive payload details

Field Description Type Required
pauseTime The time that feeding paused, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Yes

Pause directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Pause",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile associated with the feeding session>"
    },
    "payload": {
      "pauseTime": "2018-03-14T05:36Z"
    }
  }
}

Pause response event

If you handle a Pause directive successfully, respond with a standard Alexa.Response event. For more information, see Alexa.Response Interface.

Pause directive error handling

If you can't handle a Pause directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the TIMER_NOT_RUNNING or TIMER_ALREADY_PAUSED error type if appropriate.

Resume directive

Support the Resume directive so that customers can resume a feeding timer. You can resume a feeding timer retroactively. The Resume directive is not required, and is not allowed, unless the Start directive is supported.

The following examples show customer utterances:

Alexa, resume feeding.
Alexa, resume feeding two minutes ago.

Resume directive payload details

Field Description Type Required
resumeTime The time that feeding resumed, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Yes

Resume directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Resume",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile associated with the sleep session>"
    },
    "payload": {
      "resumeTime": "2018-03-14T05:38Z"
    }
  }
}

Resume response event

If you handle a Resume directive successfully, respond with a standard Alexa.Response event. For more information, see Alexa.Response Interface.

Resume directive error handling

If you can't handle a Resume directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the TIMER_NOT_RUNNING or TIMER_NOT_PAUSED error type if appropriate.

Cancel directive

Support the Cancel directive so that customers can cancel a feeding timer. The Cancel directive is not required, and is not allowed, unless the Start directive is supported.

The following example shows a customer utterance:

Alexa, cancel feeding.

Cancel directive payload details

The payload for the Cancel directive is empty.

Cancel directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Cancel",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile associated with the feeding session>"
    },
    "payload": {
    }
  }
}

Cancel response event

If you handle a Cancel directive successfully, respond with a standard Alexa.Response event. For more information, see Alexa.Response Interface.

Cancel directive error handling

If you can't handle a Cancel directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the TIMER_NOT_RUNNING error type if the timer is not running.

Stop directive

Support the Stop directive so that customers can stop timing a feeding session. You can also stop a feeding timer retroactively. The Stop directive is not required, and is not allowed, unless the Start directive is supported.

The following examples show customer utterances:

Alexa, stop feeding.
Alexa, I stopped feeding the baby five minutes ago.

Stop directive payload details

Field Description Type Required
stopTime The time that feeding stopped, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Yes
quantity The amount of liquid that was fed to the baby. A quantity object. No

Stop directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Stop",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile associated with the feeding session>"
    },
    "payload": {
      "stopTime": "2018-03-14T05:40Z",
      "quantity": {
        "value": 5,
        "unit": "US_FLUID_OUNCE"
      }
    }
  }
}

Stop response event

If you handle a Stop directive successfully, respond with a StopResponse event.

StopResponse event payload details

Field Description Type Required
duration The duration of the feeding. A duration string. Yes
entryId Your identifier for the record that you added. You can use this identifier to delete the record in case the customer added the data by mistake. String Yes

StopResponse event example

{
  "event": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "StopResponse",
      "messageId": "<message id>",
      "payloadVersion": "1",
    },
    "payload": {
      "duration": "PT8M",
      "entryId": "<entry id>"
    }
  }
}

Stop directive error handling

If you can't handle a Stop directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the TIMER_NOT_RUNNING error type if the timer is not running.

Get directive

Support the Get directive so that customers can retrieve one or more feeding measurements. The Get directive is required.

The following examples show customer utterances:

Alexa, how long ago was the last feeding?
Alexa, how long ago was the last feeding for Jane?

Get directive payload details

Field Description Type Required
maxResults The maximum number of results to return in the current page of results. Results beyond this number are paginated. Specify a number greater than zero. Integer Yes
nextToken A token to retrieve additional results if the results are paginated and there are more results. String No
filterParameters An array of filter parameter objects that filters the results of the query. Use "startTime" for the fieldName in your filter parameters when you retrieve sleep measurements. Array No
sortParameters An array of sort parameter objects that sorts the results of the query. Array No

Get directive example

{
  "directive": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "Get",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "profile": {
      "scope": {
        "token": "<an OAuth2 bearer token>"
      },
      "profileId": "<the identifier for the profile associated with the feeding measurements>"
    },
    "payload": {
      "queryParameters": {
        "maxResults": "3",
        "nextToken": "<token indicating starting offset for next paginated result>",
        "filterParameters": [
          {
            "fieldName": "startTime",
            "comparisonOperator": "GTE",
            "value": "2018-05-30T00:00:00Z"
          }
        ],
        "sortParameters": [
          {
            "fieldName": "startTime",
            "order": "DESC"
          }
        ]
      }
    }
  }
}

Get response event

If you handle a Get directive successfully, respond with a GetResponse event.

GetResponse event payload details

Field Description Type Required
nextToken A token to retrieve additional results if the results are paginated and there are more results. String No
feedingMeasurements The results of the query. An array of feedingMeasurement objects. Yes

GetResponse event example

{
  "event": {
    "header": {
      "namespace": "Alexa.Health.InfantFeeding",
      "name": "GetResponse",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "payload": {
      "nextToken": "4",
      "feedingMeasurements": [
        {
          "type": "BOTTLE",
          "startTime": "2018-05-30T20:15:00Z",
          "bottleFeeding": {
            "contentType": "FORMULA",
            "quantity": {
              "value": 5.6,
              "unit": "US_FLUID_OUNCE"
            }
          }
        },
        {
          "type": "BOTTLE",
          "startTime": "2018-05-30T18:30:00Z",
          "bottleFeeding": {
            "contentType": "FORMULA",
            "quantity": {
              "value": 6.0,
              "unit": "US_FLUID_OUNCE"
            }
          }
        },
        {
          "type": "NURSING",
          "startTime": "2018-05-30T16:00:00Z",
          "breastFeeding": {
            "type": "BOTH_SIDES",
            "dualSideBreastFeeding": {
              "leftDuration": "PT5M",
              "rightDuration": "PT7M",
              "totalDuration": "PT12M",
              "lastSide": "LEFT"
            }
          }
        }
      ]
    }
  }
}

Get directive error handling

If you can't handle a Get directive successfully, respond with an Alexa.Health.ErrorResponse event. Use the INVALID_NEXT_TOKEN error type if the nextToken is inconsistent with the filter and sort parameters. For more information, see Paginating Results.

Interface Description
Alexa.Health.Weight Describes messages for tracking weight measurements.
Alexa.Health.Sleep Describes messages for tracking and timing sleep.
Alexa.Health.DiaperChange Describes messages for tracking diaper changes.