Send feedback
curl --request POST \
--url https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Kleep-Retailer: <kleep-retailer>' \
--data '
{
"outcome": "too_large",
"comment": "A bit loose at the waist"
}
'import requests
url = "https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback"
payload = {
"outcome": "too_large",
"comment": "A bit loose at the waist"
}
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Kleep-Retailer': '<kleep-retailer>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({outcome: 'too_large', comment: 'A bit loose at the waist'})
};
fetch('https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback', 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/recommendations/{recommendation_id}/feedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'outcome' => 'too_large',
'comment' => 'A bit loose at the waist'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback"
payload := strings.NewReader("{\n \"outcome\": \"too_large\",\n \"comment\": \"A bit loose at the waist\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"too_large\",\n \"comment\": \"A bit loose at the waist\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outcome\": \"too_large\",\n \"comment\": \"A bit loose at the waist\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "recommendation_not_found",
"message": "No recommendation rec_x"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Partner API reference
Send feedback
Tell Kleep how the size turned out when the shopper says so (“the M was too big”). Kleep uses it to improve future recommendations.
POST
/
recommendations
/
{recommendation_id}
/
feedback
Send feedback
curl --request POST \
--url https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Kleep-Retailer: <kleep-retailer>' \
--data '
{
"outcome": "too_large",
"comment": "A bit loose at the waist"
}
'import requests
url = "https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback"
payload = {
"outcome": "too_large",
"comment": "A bit loose at the waist"
}
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Kleep-Retailer': '<kleep-retailer>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({outcome: 'too_large', comment: 'A bit loose at the waist'})
};
fetch('https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback', 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/recommendations/{recommendation_id}/feedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'outcome' => 'too_large',
'comment' => 'A bit loose at the waist'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback"
payload := strings.NewReader("{\n \"outcome\": \"too_large\",\n \"comment\": \"A bit loose at the waist\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"too_large\",\n \"comment\": \"A bit loose at the waist\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/recommendations/{recommendation_id}/feedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outcome\": \"too_large\",\n \"comment\": \"A bit loose at the waist\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "recommendation_not_found",
"message": "No recommendation rec_x"
}
}{
"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.
Path Parameters
Body
application/json
Response
Recorded.
