Intent Request History REST API Reference
Use the Intent Request History REST API to get the aggregated and anonymized transcriptions of user speech data and intent request details for a skill. The API returns data from customer interactions over the past 30 days, updated each day. You can use the data to learn how users interact with your skill to identify improvements to your interaction model.
This API supports text search and sort on the results. Data is available for skills that have at least 10 unique users per locale in a day. Alexa returns data for those locales that meet the threshold only.
You can view intent history in the Alexa developer console also. For details, see Review the Intent History for a Custom Skill. Or, you can view intent history by using the Alexa Skills Kit (ASK) Command Line Interface get-utterance-data
command.
API endpoint
The endpoint of the Intent Request History API is https://api.amazonalexa.com
.
Authentication
Each API request must have an authorization header whose value is the access token retrieved from Login with Amazon (LWA). For details, see Get an Access Token for SMAPI.
Operations
The Intent Request History API includes the following operations.
Operation | HTTP method and URI |
---|---|
|
Get utterance data
Get the utterance data for the last 30 days. You can define the sort and filter criteria based on a combination of attributes to sort and filter the intent history results.
Request
To get utterance data, you make a GET request to the history/intentRequests
resource.
Request path and header example
GET /v1/skills/{skillId}/history/intentRequests?maxResults={maxResults}&nextToken={nextToken}&sortDirection={sortDirection}&sortField={sortField}&dialogAct.name={dialogAct.name}&intent.confidence.bin={intent.confidence.bin}&intent.name={intent.name}&intent.slots.name={intent.slots.name}&interactionType={interactionType}&locale={locale}&publicationStatus={publicationStatus}&stage={stage}&utteranceText={utteranceText}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the skill. |
String |
Yes |
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. If not included, the Alexa service returns the first page of results. |
String |
No |
|
Query |
Set the sorting direction of the results as ascending or descending order. |
String |
No |
|
Query |
Sort the result on the specified field in alphabetical order. |
String |
No |
|
Query |
Filter based on dialog directives used in multi-turn conversations. For more details about the Dialog directive and multi-turn conversations, see Dialog Interface Reference. You can specify this filter more than one time in a request. |
String |
No |
|
Query |
Filter based on the confidence that the utterance resolved to the correct intent. Alexa doesn't send low confidence requests to your skill. You can specify this filter more than one time in a request. |
String |
No |
|
Query |
Filter based on the specified intent. You can specify this filter more than one time in a request. |
String |
No |
|
Query |
Filter based on the specified slot name. You can specify this filter more than one time in a request. |
String |
No |
|
Query |
Filter based on whether the user invoked the skill and stated the intent in a single phrase (one shot), or the user invoked the skill first, and then stated the intent (modal). |
String |
No |
|
Query |
Filter the results based on the specified locale where the interaction occurred. You can specify this filter more than one time in a request. |
String |
No |
|
Query |
Filter based on the publication status of the skill when the interaction occurred. |
String |
No |
|
Query |
Filter based on the stage of the skill. Until you publish your skill, set to |
String |
No |
|
Query |
Filter results based on whether the specified phrase is in the utterance. For example, |
String |
No |
|
Header |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of utterances that match the specified filter criteria. The results include a subset of utterances sent to your skill, filtered to include frequent utterances that meet the daily user threshold. The response might not contain any utterances.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
The following example shows a response sorted on the intent.confidence.bin
field in descending order.
{
"body": {
"_links": {
"self": {
"href": "v1/skills/amzn1.ask.skill.1/history/intentRequests?nextToken=someToken1&maxResults=5&sortDirection=desc&sortField=intent.confidence.bin&locale=en-US&locale=en-GB&locale=de-DE&intent.confidence.bin=HIGH&intent.confidence.bin=MEDIUM&stage=development&publicationStatus=CERTIFICATION&dialogAct.name=Dialog.ElicitSlot&dialogAct.name=Dialog.ConfirmSlot&intent.slots.name=answer&utteranceText=answer&intent.name=AnswerIntent&interactionType=MODAL"
},
"next": {
"href": "v1/skills/amzn1.ask.skill.1/history/intentRequests?nextToken=someToken2&maxResults=5&sortDirection=desc&sortField=intent.confidence.bin&locale=en-US&locale=en-GB&locale=de-DE&intent.confidence.bin=HIGH&intent.confidence.bin=MEDIUM&stage=development&publicationStatus=CERTIFICATION&dialogAct.name=Dialog.ElicitSlot&dialogAct.name=Dialog.ConfirmSlot&intent.slots.name=answer&utteranceText=answer&intent.name=AnswerIntent&interactionType=MODAL"
}
},
"isTruncated": true,
"nextToken": "someToken.1",
"totalCount": 15,
"startIndex": 0,
"skillId": "amzn1.ask.skill.1",
"items": [{
"dialogAct": {
"name": "Dialog.ConfirmSlot"
},
"intent": {
"name": "AnswerIntent",
"confidence": {
"bin": "HIGH"
},
"slots": {
"answer": {
"name": "answer"
}
}
},
"locale": "en-GB",
"interactionType": "MODAL",
"stage": "development",
"publicationStatus": "CERTIFICATION",
"utteranceText": "the answer is k"
},
{
"dialogAct": {
"name": "Dialog.ConfirmSlot"
},
"intent": {
"name": "AnswerIntent",
"confidence": {
"bin": "HIGH"
},
"slots": {
"answer": {
"name": "answer"
}
}
},
"locale": "en-GB",
"interactionType": "MODAL",
"stage": "development",
"publicationStatus": "CERTIFICATION",
"utteranceText": "ask game trivia the answer is elephant"
},
{
"dialogAct": {
"name": "Dialog.ElicitSlot"
},
"intent": {
"name": "AnswerIntent",
"confidence": {
"bin": "HIGH"
},
"slots": {
"answer": {
"name": "answer"
}
}
},
"locale": "en-US",
"interactionType": "MODAL",
"stage": "development",
"publicationStatus": "CERTIFICATION",
"utteranceText": "the answer is apollo"
},
{
"dialogAct": {
"name": "Dialog.ConfirmSlot"
},
"intent": {
"name": "AnswerIntent",
"confidence": {
"bin": "MEDIUM"
},
"slots": {
"answer": {
"name": "answer"
}
}
},
"locale": "en-US",
"interactionType": "MODAL",
"stage": "development",
"publicationStatus": "CERTIFICATION",
"utteranceText": "the answer is tetris"
},
{
"dialogAct": {
"name": "Dialog.ConfirmSlot"
},
"intent": {
"name": "AnswerIntent",
"confidence": {
"bin": "MEDIUM"
},
"slots": {
"answer": {
"name": "answer"
}
}
},
"locale": "en-US",
"interactionType": "MODAL",
"stage": "development",
"publicationStatus": "CERTIFICATION",
"utteranceText": "the answer is washington d. c."
}
]
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
Links for item navigation. |
_links object |
|
Indicates whether there are more items to return. If set to |
Boolean |
|
(Optional) Included when there are more results to return. Use this value in a subsequent request. |
String |
|
Total number of results that matched the query. |
Integer |
|
Position of the current page in the result set. |
Integer |
|
Identifies the skill to which the intent request history data applies. |
String |
|
Filtered list of intent requests for the skill. |
Array of objects |
|
Dialog directive used in this interaction. |
String |
|
Confidence level of this interaction. |
String |
|
Intent used in this interaction. |
String |
|
Slots returned to the skill in this interaction. |
String |
|
Indicates whether the user invoked the skill and stated the intent in a single phrase (one shot), or the user invoked the skill first, and then stated the intent (modal). |
String |
|
Locale in which this interaction occurred. |
String |
|
Publication stage of the skill when this interaction occurred. |
String |
|
Skill stage in which this interaction occurred. |
String |
|
Actual utterance text spoken by the user. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of intent data. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Object definitions
The Intent Request History API defines the following objects.
Locale values
The following table shows valid values for the locale
property.
Locale code | Language |
---|---|
|
Arabic (SA) |
|
German (DE) |
|
English (AU) |
|
English (CA) |
|
English (UK) |
|
English (IN) |
|
English (US) |
|
Spanish (ES) |
|
Spanish (MX) |
|
Spanish (US) |
|
French (CA) |
|
French (FR) |
|
Hindi (IN) |
|
Italian (IT) |
|
Japanese (JP) |
|
Dutch (NL) |
|
Portuguese (BR) |
Related topics
Last updated: Aug 01, 2024