PutEvents
Records item interaction event data. For more information see Recording item interaction events.
Note
If you use an AWS Lambda function to call the PutEvents operation, your function's execution role must have permission to perform the personalize:PutEvents
action with the wildcard *
in the Resource
element.
Request Syntax
POST /events HTTP/1.1
Content-type: application/json
{
"eventList": [
{
"eventId": "string
",
"eventType": "string
",
"eventValue": number
,
"impression": [ "string
" ],
"itemId": "string
",
"metricAttribution": {
"eventAttributionSource": "string
"
},
"properties": "string
",
"recommendationId": "string
",
"sentAt": number
}
],
"sessionId": "string
",
"trackingId": "string
",
"userId": "string
"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- eventList
-
A list of event data from the session.
Type: Array of Event objects
Array Members: Minimum number of 1 item. Maximum number of 10 items.
Required: Yes
- sessionId
-
The session ID associated with the user's visit. Your application generates the sessionId when a user first visits your website or uses your application. Amazon Personalize uses the sessionId to associate events with the user before they log in. For more information, see Recording item interaction events.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: Yes
- trackingId
-
The tracking ID for the event. The ID is generated by a call to the CreateEventTracker API.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: Yes
- userId
-
The user associated with the event.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: No
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
- InvalidInputException
-
Provide a valid value for the field or parameter.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: