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

GetNextPage Directives (VSK MM)

When users select to go to the "next page" of search results, or when they scroll beyond the viewable search results on the screen, the VideoContentProvider API sends a GetNextPage directive to your Lambda to fetch more results. Your response provides additional items to populate the next page.

The following diagram shows this workflow:

GetNextPage Directive and Lambda GetNextPageResponse

Utterances for GetNextPage Directives

Feature Sample Utterances Expected Response
Get Next Page

Get Next page

[translation coming soon]

[translation coming soon]

[translation coming soon]

[translation coming soon]

[translation coming soon]

The next page of results appears on the screen.

Handling GetNextPage Directives

After receiving search results from your Lambda (through your GetDisplayableItemsMetadataResponse), a user might want to see additional search results, or "the next page" of search results. Users can paginate to the next page of search results with a simple phrase such as "Get next page."

This prompts Alexa to send a GetNextPage directive. Your Lambda response to this directive should include basic metadata for search results. The response is analogous to GetDisplayableItemsResponse.

After Alexa receives your GetNextPageResponse, Alexa will follow up with a GetDisplayableItemsMetadata directive as more information is needed.

GetNextPage Example

The following is an example GetNextPage directive. Note the minResultLimit and maxResultLimit for the items you must send.

{
    "directive": {
        "header": {
            "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
            "messageId": "9f4803ec-4c94-4fdf-89c2-d502d5e52bb4",
            "name": "GetNextPage",
            "namespace": "Alexa.VideoContentProvider",
            "payloadVersion": "3"
        },
        "endpoint": {
            "cookie": {

            },
            "endpointId": "<the identifier of the target endpoint>",
            "scope": {
                "token": "<an OAuth2 bearer token>",
                "type": "BearerToken"
            }
        },
        "payload": {
            "nextToken": "fvkjbr20dvjbkwOpqStr",
            "minResultLimit": 8,
            "maxResultLimit": 25
        }
    }
}

Payload Descriptions

The following table describes the payload for GetNextPage directives.

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
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

Lambda Response

Your Lambda response should be a list of items to display on the device.

Response Example

The following is an example of the GetNextPageResponse that your Lambda should send. This payload follows the same format as GetDisplayableItemsMetadata.

{
    "event": {
        "header": {
            "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
            "messageId": "9f4803ec-4c94-4fdf-89c2-d502d5e52bb4",
            "name": "GetNextPageResponse",
            "namespace": "Alexa.VideoContentProvider",
            "payloadVersion": "3"
        },
        "endpoint": {
            "scope": {
                "type": "BearerToken",
                "token": "Alexa-access-token"
            },
            "endpointId": "appliance-001"
        },
        "payload": {
            "nextToken": "qefjrfiugef74",
            "mediaItems": [
                {
                    "mediaIdentifier": {
                        "id": "recordingId://provider1.dvr.rp.1234-2345-63434-asdf"
                    }
                },
                {
                    "mediaIdentifier": {
                        "id": "recordingId://provider1.dvr.rp.1234-2345-63434-asdf"
                    }
                }
            ]
        }
    }
}

Payload Descriptions

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
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