GetSnapshots - Amazon Kendra API Reference

GetSnapshots

Retrieves search metrics data. The data provides a snapshot of how your users interact with your search application and how effective the application is.

Request Syntax

{ "IndexId": "string", "Interval": "string", "MaxResults": number, "MetricType": "string", "NextToken": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

IndexId

The identifier of the index to get search metrics data.

Type: String

Length Constraints: Fixed length of 36.

Pattern: [a-zA-Z0-9][a-zA-Z0-9-]*

Required: Yes

Interval

The time interval or time window to get search metrics data. The time interval uses the time zone of your index. You can view data in the following time windows:

  • THIS_WEEK: The current week, starting on the Sunday and ending on the day before the current date.

  • ONE_WEEK_AGO: The previous week, starting on the Sunday and ending on the following Saturday.

  • TWO_WEEKS_AGO: The week before the previous week, starting on the Sunday and ending on the following Saturday.

  • THIS_MONTH: The current month, starting on the first day of the month and ending on the day before the current date.

  • ONE_MONTH_AGO: The previous month, starting on the first day of the month and ending on the last day of the month.

  • TWO_MONTHS_AGO: The month before the previous month, starting on the first day of the month and ending on last day of the month.

Type: String

Valid Values: THIS_MONTH | THIS_WEEK | ONE_WEEK_AGO | TWO_WEEKS_AGO | ONE_MONTH_AGO | TWO_MONTHS_AGO

Required: Yes

MaxResults

The maximum number of returned data for the metric.

Type: Integer

Required: No

MetricType

The metric you want to retrieve. You can specify only one metric per call.

For more information about the metrics you can view, see Gaining insights with search analytics.

Type: String

Valid Values: QUERIES_BY_COUNT | QUERIES_BY_ZERO_CLICK_RATE | QUERIES_BY_ZERO_RESULT_RATE | DOCS_BY_CLICK_COUNT | AGG_QUERY_DOC_METRICS | TREND_QUERY_DOC_METRICS

Required: Yes

NextToken

If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of search metrics data.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 800.

Required: No

Response Syntax

{ "NextToken": "string", "SnapshotsData": [ [ "string" ] ], "SnapshotsDataHeader": [ "string" ], "SnapShotTimeFilter": { "EndTime": number, "StartTime": number } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

If the response is truncated, Amazon Kendra returns this token, which you can use in a later request to retrieve the next set of search metrics data.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 800.

SnapshotsData

The search metrics data. The data returned depends on the metric type you requested.

Type: Array of arrays of strings

Length Constraints: Minimum length of 1. Maximum length of 2048.

SnapshotsDataHeader

The column headers for the search metrics data.

Type: Array of strings

Length Constraints: Minimum length of 1. Maximum length of 2048.

SnapShotTimeFilter

The Unix timestamp for the beginning and end of the time window for the search metrics data.

Type: TimeRange object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have sufficient access to perform this action. Please ensure you have the required permission policies and user accounts and try again.

HTTP Status Code: 400

InternalServerException

An issue occurred with the internal server used for your Amazon Kendra service. Please wait a few minutes and try again, or contact Support for help.

HTTP Status Code: 500

InvalidRequestException

The input to the request is not valid. Please provide the correct input and try again.

HTTP Status Code: 400

ResourceNotFoundException

The resource you want to use doesn’t exist. Please check you have provided the correct resource and try again.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: