Documentation of Revery's virtual dressing room API for Developers.
Updates:
Authentication is used for all the APIs. To perform authentication, you should use the public_key and secret_key from the console page under “Account Info”.
We adopt the pbkdf2 algorithm for authentication. Use the secret_key as password, and the current unix time in seconds as the salt, to produce an encrypted one_time_code. For authenticated endpoints, attach the one_time_code and the unix time in the header to authenticate.
Pbkdf2 parameters:
password: string, secret key
salt: string, unix time in seconds
iterations: int, 128
keylen: int, 32
digest: string, sha256
Javascript example:
getAuthenticationHeader(public_key, secret_key) {
var pbkdf2 = require('pbkdf2')
let time = parseInt(Date.now()/1000);
var derivedKey = pbkdf2.pbkdf2Sync(secret_key, time.toString(), 128, 32, 'sha256');
derivedKey = derivedKey.toString('hex');
return new Headers({
"public_key": public_key,
"one_time_code": derivedKey,
"timestamp": time,
})
}
Add a garment to the catalog.
Endpoint: https://api.revery.ai/console/v2/process_new_garment
Method: POST
JSON Parameters (body):
category: string, one of tops, bottoms, outerwear, allbody
bottoms_sub_category: string, if category is bottoms
you must specify the type of bottom from one of pants, shorts, skirts
gender: string, one of female
or male
garment_img_url: string, url to the ghost mannequin image
brand: string, (optional)
url: string, garment page url (optional)
{
"category": "tops",
"gender": "male",
"garment_img_url": "<https://revery-integration-tools.s3.us-east-2.amazonaws.com/API_website/tops.jpeg>"
}