List questions
curl --request GET \
--url https://fit.kleep.ai/v1/questions \
--header 'Authorization: Bearer <token>' \
--header 'Kleep-Retailer: <kleep-retailer>'import requests
url = "https://fit.kleep.ai/v1/questions"
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Kleep-Retailer': '<kleep-retailer>', Authorization: 'Bearer <token>'}
};
fetch('https://fit.kleep.ai/v1/questions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fit.kleep.ai/v1/questions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Kleep-Retailer: <kleep-retailer>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://fit.kleep.ai/v1/questions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fit.kleep.ai/v1/questions")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/questions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"questions": [
{
"id": "gender",
"required": true,
"type": "choice",
"prompt": "Do you shop women's or men's sizes?",
"options": [
{
"value": "female",
"label": "Women's"
},
{
"value": "male",
"label": "Men's"
}
]
},
{
"id": "height_cm",
"required": true,
"type": "number",
"unit": "cm",
"min": 120,
"max": 230,
"prompt": "How tall are you?"
},
{
"id": "weight_kg",
"required": true,
"type": "number",
"unit": "kg",
"min": 20,
"max": 250,
"prompt": "How much do you weigh?"
},
{
"id": "age",
"required": true,
"type": "integer",
"min": 12,
"max": 100,
"prompt": "How old are you?"
},
{
"id": "body_shape.stomach",
"required": false,
"type": "choice",
"default": "medium",
"prompt": "How would you describe your stomach?",
"options": [
{
"value": "flat",
"label": "Flat"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "round",
"label": "Round"
}
]
},
{
"id": "body_shape.hips",
"required": false,
"type": "choice",
"default": "medium",
"prompt": "And your hips?",
"options": [
{
"value": "narrow",
"label": "Narrow"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "wide",
"label": "Wide"
}
]
}
]
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Partner API reference
List questions
The questions to ask a shopper for a category, localized and in the recommended order. Use it to script your bot, or rely on missing_inputs from Create recommendation instead.
GET
/
questions
List questions
curl --request GET \
--url https://fit.kleep.ai/v1/questions \
--header 'Authorization: Bearer <token>' \
--header 'Kleep-Retailer: <kleep-retailer>'import requests
url = "https://fit.kleep.ai/v1/questions"
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Kleep-Retailer': '<kleep-retailer>', Authorization: 'Bearer <token>'}
};
fetch('https://fit.kleep.ai/v1/questions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fit.kleep.ai/v1/questions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Kleep-Retailer: <kleep-retailer>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://fit.kleep.ai/v1/questions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fit.kleep.ai/v1/questions")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/questions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"questions": [
{
"id": "gender",
"required": true,
"type": "choice",
"prompt": "Do you shop women's or men's sizes?",
"options": [
{
"value": "female",
"label": "Women's"
},
{
"value": "male",
"label": "Men's"
}
]
},
{
"id": "height_cm",
"required": true,
"type": "number",
"unit": "cm",
"min": 120,
"max": 230,
"prompt": "How tall are you?"
},
{
"id": "weight_kg",
"required": true,
"type": "number",
"unit": "kg",
"min": 20,
"max": 250,
"prompt": "How much do you weigh?"
},
{
"id": "age",
"required": true,
"type": "integer",
"min": 12,
"max": 100,
"prompt": "How old are you?"
},
{
"id": "body_shape.stomach",
"required": false,
"type": "choice",
"default": "medium",
"prompt": "How would you describe your stomach?",
"options": [
{
"value": "flat",
"label": "Flat"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "round",
"label": "Round"
}
]
},
{
"id": "body_shape.hips",
"required": false,
"type": "choice",
"default": "medium",
"prompt": "And your hips?",
"options": [
{
"value": "narrow",
"label": "Narrow"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "wide",
"label": "Wide"
}
]
}
]
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Authorizations
Your partner API key: kp_live_… in production, kp_test_… on the sandbox retailer.
Headers
The retailer's Kleep public_id. Every call is scoped to one retailer.
Query Parameters
Sizing category of the product. It decides which questions apply.
Available options:
clothing, lingerie, footwear, kids Omit to get the gender question plus both variants.
Available options:
female, male BCP 47 language tag for prompts and sentences, for example fr-FR.
Response
Questions.
Show child attributes
Show child attributes
