Availability filters
Availability filters enable filtering recommendation by user attributes.
Recommendation request might include additional user attributes such as:
{
...
"location": {
"country": "CA",
"state": "QC"
},
"traits": {
"currency": "CAD",
"language": "en",
"license": "CA",
"ageVerified": false
},
"skinId": "98761234",
...
}
To filter recommendation response by user attributes it is required to include availability filters in the provided game inventory. Please check gaming inventory schema inventory schema as reference.
Recommendation request user attributes mapping:
User attribute | Payload field |
---|---|
country | location.country |
state | location.state |
currency | traits.currency |
language | traits.language |
license | traits.license |
age_verified | traits.ageVerified |
skin_id | skinId |
Example
Gaming inventory includes two games:
{
"123456": {
"game_code": "123456",
"game_name": "Adventure Quest",
"skin_id": ["21", "23"],
"inclusions": {"country": "CA", "state": ["QC", "ON"]},
"exclusions": {"language": "fr"},
...
},
"654321": {
"game_code": "654321",
"game_name": "King Slots",
"skin_id": ["21"],
"inclusions": {"country": ["CA", "US"]},
"exclusions": {"language": "fr"},
...
}
}
Recommendation request looks as follows:
{
"userId": "156784322",
"type": "recommendation",
"context": {
"channel": "Desktop",
},
"skinId": "21",
"location": {
"country": "CA",
"state": "BC"
},
"traits": {
"language": "en"
},
"recommendation": {
"target": {
"getDetails": true
}
}
}
User attributes attached to the request skinId
, country
and language
match both games but only second game is returned because first game is limited to states "QC" and "ON" while request contain state
"BC".
If language
would be set to "fr" then both games would be excluded from the response.
Updated 4 months ago