Amazon Personalize
Developer Guide

GetPersonalizedRanking

Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user.

Note

The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.

Request Syntax

POST /personalize-ranking HTTP/1.1 Content-type: application/json { "campaignArn": "string", "inputList": [ "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.

campaignArn

The Amazon Resource Name (ARN) of the campaign to use for generating the personalized ranking.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:([a-z\d-]+):personalize:.*:.*:.+

Required: Yes

inputList

A list of items (itemId's) to rank. If an item was not included in the training dataset, the item is appended to the end of the reranked list.

Type: Array of strings

Array Members: Maximum number of 100 items.

Length Constraints: Maximum length of 256.

Required: Yes

userId

The user for which you want the campaign to provide a personalized ranking.

Type: String

Length Constraints: Maximum length of 256.

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "personalizedRanking": [ { "itemId": "string" } ] }

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.

personalizedRanking

A list of items in order of most likely interest to the user.

Type: Array of PredictedItem objects

Array Members: Maximum number of 100 items.

Errors

InvalidInputException

Provide a valid value for the field or parameter.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

See Also

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