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

GetBrowseNodeItems Directives (VSK MM)

When a user selects a search result on the screen whose selection action is set to display another layer of search results, rather than initiate playback, the VideoContentProvider API sends a GetBrowseNodeItems directive to your Lambda to get items for that "browse node group." This directive is often used when users choose to browse a watch list, video library, or recordings on the device.

The following diagram shows the Alexa directive and expected Lambda response:

Handling GetBrowseNodeItems Directives

The GetDisplayableItemsResponse provides items to populate a search results page or other templates, such as landing page, that provide items to browse and select.

When search results are shown on the screen, you can combine similar items together into a logical group. For example, for an utterance like "Show me my recordings," you can group TV Shows into one group and Movies into another group. The display on the device depends on the value of selectionAction from your GetDisplayableItemsResponse. The value for the selectionAction determines how the items get grouped.

When users select a group (e.g., "Alexa, select [X]"), they can then view more results from that group. Selecting a group prompts Alexa to send a GetBrowseNodeItems to get items from that group.

To demonstrate how browse node groups work, turn to your Echo Show and "Open Prime Video" (or say "Video Home" and then tap the "Prime Video" skill). The screen shows a series of browse node groups like this:

Browse Node Groups
Browse Node Groups

You can then either tap a node (category) or say "Alexa, select Prime movies," for example. Alexa sends the GetBrowseNodeItems directive to allow the user to drill down into a specific browse node item. The display on the device depends on the value of selectionAction (from your Lambda's GetDisplayableItemsMetadataResponse):

  • If the value of selectionAction is BROWSE, you have more search results to show on the screen when the users select this item on the device. After the user selects the category, Alexa sends a GetBrowseNodeItems directive to get more mediaIdentifiers, and then sends a GetDisplayableItemsMetadata directive for those items to display results on the screen.

  • If the value of the selectionAction field is set to PLAY, you need to play the item if the user selects it. In such cases, Alexa sends a GetPlayableItemsMetadata directive.

GetBrowseNodeItems Example

The following is an example of a GetBrowseNodeItems directive.

{
    "directive": {
        "header": {
            "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
            "messageId": "0f918d6e-ebae-48f1-a237-13c6f5b9f5da",
            "name": "GetBrowseNodeItems",
            "namespace": "Alexa.VideoContentProvider",
            "payloadVersion": "3"
        },
        "endpoint": {
            "scope": {
                "type": "BearerToken",
                "token": "access-token-from-skill"
            },
            "endpointId": "videoDevice-001",
            "cookie": {

            }
        },
        "payload": {
            "minResultLimit": 8,
            "maxResultLimit": 25,
            "mediaIdentifier": {
                "id": "recordingId://provider1.dvr.rp.1234-2345-63434-asdf"
            }
        }
    }
}

Payload Descriptions

The following table describes the payload fields in the GetBrowseNodeItems code sample.

Payload Descriptions
Field Description Data Type
minResultLimit
required

The minimum number of results to return in this call for which a pageToken is accepted. If you return less than the minResultLimit field along with a pageToken to fetch more results, then Alexa does not consider the pageToken to fetch the new items and only displays whatever Alexa received.

For a pageToken to be considered for fetching more results, the number of items have to match at least the value in minResultLimit. However, the number of items can be more than minResultLimit up to a max of maxResultLimit. If the number of items is more than the maxResultLimit, Alexa discards the items after the maxResultLimit.

Example: 8

Integer
maxResultLimit
required

A limit to the maximum number of results to return. See description of minResultLimit field for more details.

Example: 25

Integer
mediaIdentifier
required

Identifier for the mediaItem.

Object
id
required

An identifier for the video item that is used to fetch any display or playback related metadata information on subsequent calls to GetDisplayableItemsMetadata or GetPlayableItemsMetadata. This identifier is opaque to Alexa and is just used as-is when querying for metadata information.

String

Lambda Response

When you receive a GetBrowseNodeItems directive, your Lambda's response should include basic metadata about search results to display (for example, a list of IDs for the items in the requested group). The response is analogous to GetDisplayableItems. Alexa will follow up with GetDisplayableItemsMetadata directive when more information is needed.

Response Example

The following is an example of the GetBrowseNodeItemsResponse your Lambda should send.

{
    "event": {
        "header": {
            "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
            "messageId": "5f0a0546-caad-416f-a617-80cf083a05cd",
            "name": "GetBrowseNodeItemsResponse",
            "namespace": "Alexa.VideoContentProvider",
            "payloadVersion": "3"
        },
        "payload": {
            "nextToken": "fvkjbr20dvjbkwOpqStr",
            "mediaItems": [
                {
                    "mediaIdentifier": {
                        "id": "recordingId://provider1.dvr.rp.1234-2345-63434-asdf"
                    }
                },
                {
                    "mediaIdentifier": {
                        "id": "recordingId://provider1.dvr.rp.1234-2345-63434-asdf"
                    }
                }
            ]
        }
    }
}

Payload Descriptions

The following table describes the payload fields in the GetBrowseNodeItemsResponse code sample.

Payload Descriptions
Field Description Data Type
nextToken

Token to fetch the next set of results. An opaque string sent by the provider which is passed back in subsequent search requests.

String
mediaItems
required

A list of mediaIdentifiers for the videos that are shown as search results on the screen.

List
mediaIdentifiers
required

Contains a list of `id` values for the media.

Array
id
required

An identifier for the video item that is used to fetch any display or playback related metadata information on subsequent calls to GetDisplayableItemsMetadata or GetPlayableItemsMetadata. This identifier is opaque to Alexa and is just used as-is when querying for metadata information.

String