v1
latestOpenAPI 3.0.22026-08-0426137631.3 KBUser to Attributes API
The User to Attributes API is a generalized version of User to Categories API --- it returns the product attributes that Miso expects to drive a conversion for the current user. You specify a field in your Product catalog you want recommendations for, e.g. the brand or a custom field like custom_attributes.director, and this API will return a list of values from that fields Miso expects users will be most interested in, as well as a list of personalized product suggestions.
Applicable scenarios
This API is usually used in homepage recommendations, where users can interact with recommended attributes. For example, this API could generate suggestions for "the brands you may like" or "the creators you may like."
Basic usage
For basic usage of this API, you just need to let Miso knows the user_id or anonymous_id, and the field you want to get recommendations for. For example, the following request will return the recommended director for the given users:
POST https://api.askmiso.com/v1/recommendation/user_to_attributes
{
"user_id": "test",
"field": "custom_attributes.director",
"rows": 3,
"products_per_attribute": 2,
"fl": ["title"]
}
- field: the name of the field you want to get recommendation for
- rows: the number of categories to return
- products_per_attribute: the number of Products to return per each attribute
- fl: like in other Miso API, you can use fl to control which fields to return for each Product
The response of this request will be like:
{
"message": "success",
"data": {
"took": 296,
"miso_id": "9d7c8d9c-dd73-11eb-b20d-9a566192e5c6",
"attributes": [
{
"value": "Christopher Nolan",
"total": 12,
"recommended_products": [
{
"product_id": "tmdb-272",
"title": "Batman Begins (2005)"
},
{
"product_id": "tmdb-77",
"title": "Memento (2000)"
}
]
},
{
"value": "Ridley Scott",
"total": 26,
"recommended_products": [
{
"product_id": "tmdb-286217",
"title": "The Martian (2015)"
},
{
"product_id": "tmdb-4982",
"title": "American Gangster (2007)"
}
]
},
{
"value": "Quentin Tarantino",
"total": 13,
"recommended_products": [
{
"product_id": "tmdb-680",
"title": "Pulp Fiction (1994)"
},
{
"product_id": "tmdb-68718",
"title": "Django Unchained (2012)"
}
]
}
]
}
}
- attributes: a list of attributes recommended to the users.
- attributes[ ].value: the recommended attribute value (in this case, director name)
- attributes[ ].total: the total number of Products that have this attribute
- attributes[ ].recommended_products: a list of Products (with the attribute) recommended to the users
Request body
Example request
{
"boosting_tags": [
"tag-1",
"quetag-2"
],
"additional_interactions": [
{
"duration": 61.5,
"product_ids": [
"123ABC-BLACK"
],
"product_group_ids": [
"123ABC"
],
"user_id": "user_1234",
"anonymous_id": "86D51273AD8BF84217E1567B6CBE7152D7034404",
"miso_id": "123e4567-e89b-12d3-a456-426614174000",
"context": {
"campaign": {
"name": "spring_sale",
"source": "Google",
"medium": "cpc",
"term": "running+shoes",
"content": "textlink"
},
"truncated_ip": "1.1.1.0",
"locale": "en-US",
"region": "US East",
"page": {
"url": "https://example.com/miso-tshirt-123ABC",
"referrer": "https://example.com/",
"title": "My Product Page"
},
"user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
"custom_context": {
"session_variable_1": [
"value_1",
"value_2"
]
}
}
}
],
"custom_context": {
"session_variable_1": [
"value_1",
"value_2"
]
}
}Response
Successful Response
Example response
{
"data": {
"miso_id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": [
{
"value": "Miso T-Shirt Shop",
"total": 1000,
"recommended_products": [
{
"product_id": "123ABC-S-Black"
}
]
}
]
}
}