Product Recommendations (Target response time < 200ms)
const url = 'https://partner-test.revieve.com/api/functions/getRecommendedProducts';const options = { method: 'POST', headers: { 'X-Parse-Application-Id': '<X-Parse-Application-Id>', 'Content-Type': 'application/json' }, body: '{"partner_id":"jmlv6b2qtS","user_id":"example.user.id","gender_ui":"female","age_ui":35,"eyebags_ui":0.8,"oily_skin_ui":1,"wrinkles_cv":0.212,"organic_ui":1,"price_groups":{"default":{"economy":[1,20],"standard":[20,50],"highend":[50,400]},"Moisturizer":{"economy":[3,10],"standard":[10,20],"highend":[20,200]}},"single_brand":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://partner-test.revieve.com/api/functions/getRecommendedProducts \ --header 'Content-Type: application/json' \ --header 'X-Parse-Application-Id: <X-Parse-Application-Id>' \ --data '{ "partner_id": "jmlv6b2qtS", "user_id": "example.user.id", "gender_ui": "female", "age_ui": 35, "eyebags_ui": 0.8, "oily_skin_ui": 1, "wrinkles_cv": 0.212, "organic_ui": 1, "price_groups": { "default": { "economy": [ 1, 20 ], "standard": [ 20, 50 ], "highend": [ 50, 400 ] }, "Moisturizer": { "economy": [ 3, 10 ], "standard": [ 10, 20 ], "highend": [ 20, 200 ] } }, "single_brand": 1 }'Get product recommendations based on user variables.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”The request object
object
Partner ID
Example
jmlv6b2qtSUser ID
Example
example.user.idCategories we are interested in
Example
[ "Moisturizer", "Cleanser"]Gender, ‘male’ or ‘female’
Example
femaleYear of birth, eg. 1983
User latitude (setting this will override Revieve’s server side GeoIP)
Example
39.40274User longitude (setting this will override Revieve’s server side GeoIP)
Example
-0.40352User’s city (setting this will override Revieve’s server side GeoIP)
Example
CatarrojaUser’s geografical area (setting this will override Revieve’s server side GeoIP)
Example
ValenciaUser’s country (setting this will override Revieve’s server side GeoIP)
Example
SpainHow prominent wrinkles user has in their opinion between 0.0 - 1.0.
How prominent eyebags user has in their opinion between 0.0 - 1.0.
How prominent dark spots user has in their opinion between 0.0 - 1.0.
How prominent dark circles user has in computer visions opinion between 0.0 - 1.0.
How prominent wrinkles user has in computer visions opinion between 0.0 - 1.0.
How prominent eyebags_cv user has in computer visions opinion between 0.0 - 1.0.
How prominent redness user has in computer visions opinion between 0.0 - 1.0.
How prominent hyperpigmentation user has in computer visions opinion between 0.0 - 1.0.
If the user has skin concern “cuperose”, set this to 1
If the user has skin concern “rocasea”, set this to 1
If the user has skin concern “acne”, set this to 1
If the user has skin concern “eczema”, set this to 1
If the user has skin concern “hyperpigmentation”, set this to 1
If the user has skin concern “oilyness”, set this to 1
If the user has skin concern “dull and tired skin”, set this to 1
If the user has skin concern “psoriasis”, set this to 1
If the user has skin concern “sensitive skin”, set this to 1
If user has skintype “normal”, set to 1. Only set one skintype.
If user has skintype “dry skin”, set to 1. Only set one skintype.
If user has skintype “combination skin”, set to 1. Only set one skintype.
If user has skintype “oily skin”, set to 1. Only set one skintype.
If user has skintype “sensitive skin”, set to 1. Only set one skintype.
If user prefers organic products, set to 1.
If user prefers anti aging products, set to 1.
If user prefers fragrance free products, set to 1.
If user prefers paraben free products, set to 1.
If user prefers sun protecting products, set to 1.
If user prefers skin brightening products, set to 1.
If user prefers skin firming products, set to 1.
If user prefers vegan products, set to 1.
If user prefers natural products, set to 1.
If user prefers allergy friendly products, set to 1.
If user prefers essential oil free products, set to 1.
If user prefers preservative free products, set to 1.
If user prefers gluten free products, set to 1.
If user prefers alcohol free products, set to 1.
If user prefers coconut free products, set to 1.
If user prefers sweat resistant products, set to 1.
If user prefers water resistant products, set to 1.
If user prefers dermatologist tested products, set to 1.
If user prefers cruelty free products, set to 1.
If user prefers socially responsible products, set to 1.
If user prefers sustainably sourced products, set to 1.
If user prefers chemical free sun protection products, set to 1.
If user prefers silicone free products, set to 1.
If user prefers non GMO products, set to 1.
Array with product tag required in a product to be included in results
Example
[ "cruelty_free_ui", "natural_ui"]Price groups where products must be distributed in results.
object
Product’s category
object
Price group name
Example
{ "application/json": { "default": { "economy": [ 1, 20 ], "standard": [ 20, 50 ], "highend": [ 50, 400 ] }, "Moisturizer": { "economy": [ 3, 10 ], "standard": [ 10, 20 ], "highend": [ 20, 200 ] } }}If set to 1, each price group will all be selected from only one brand, that best fits to the query parameters. Currently requires price groups to also be set in the query.
Array of brands to be excluded from the results
Example
[ "Nuxe"]Array of brands to be included in the results (no others will be taken into account)
Example
[ "Clinique", "Biotherm"]User’s undertone in computer visions opinion. Possible values ‘-1’= ‘Cool’, ‘0’= ‘Neutral’, ‘1’= ‘Warm’
Example
1Example
{ "partner_id": "jmlv6b2qtS", "user_id": "example.user.id", "gender_ui": "female", "age_ui": 35, "eyebags_ui": 0.8, "oily_skin_ui": 1, "wrinkles_cv": 0.212, "organic_ui": 1, "price_groups": { "default": { "economy": [ 1, 20 ], "standard": [ 20, 50 ], "highend": [ 50, 400 ] }, "Moisturizer": { "economy": [ 3, 10 ], "standard": [ 10, 20 ], "highend": [ 20, 200 ] } }, "single_brand": 1}Responses
Section titled “ Responses ”Product recommendations
object
object
Unique ID for this query. Save the latest one in your backend for each user, so you can post it to Revieve in the event of product purchase. This makes it possible for us to track recommendation changes per user.
Variables used
object
Object of products with category as a key
object
Example generated
{ "result": { "history_id": "example", "variables": {}, "products": {} }}default
Section titled “default ”Unexpected error
object
Example generated
{ "code": 1, "message": "example"}