Get profile
curl --request GET \
--url https://fit.kleep.ai/v1/profiles/{profile_id} \
--header 'Authorization: Bearer <token>' \
--header 'Kleep-Retailer: <kleep-retailer>'import requests
url = "https://fit.kleep.ai/v1/profiles/{profile_id}"
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/profiles/{profile_id}', 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/profiles/{profile_id}",
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/profiles/{profile_id}"
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/profiles/{profile_id}")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/profiles/{profile_id}")
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{
"profile_id": "<string>",
"measurements": {
"gender": "female",
"age": 34,
"height_cm": 168,
"weight_kg": 61,
"body_shape": {
"stomach": "medium",
"hips": "wide"
}
},
"customer_id": "<string>",
"source": "conversation",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "profile_not_found",
"message": "No profile prf_x"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Partner API reference
Get profile
GET
/
profiles
/
{profile_id}
Get profile
curl --request GET \
--url https://fit.kleep.ai/v1/profiles/{profile_id} \
--header 'Authorization: Bearer <token>' \
--header 'Kleep-Retailer: <kleep-retailer>'import requests
url = "https://fit.kleep.ai/v1/profiles/{profile_id}"
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/profiles/{profile_id}', 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/profiles/{profile_id}",
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/profiles/{profile_id}"
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/profiles/{profile_id}")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/profiles/{profile_id}")
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{
"profile_id": "<string>",
"measurements": {
"gender": "female",
"age": 34,
"height_cm": 168,
"weight_kg": 61,
"body_shape": {
"stomach": "medium",
"hips": "wide"
}
},
"customer_id": "<string>",
"source": "conversation",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "profile_not_found",
"message": "No profile prf_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
Response
The profile.
What the shopper tells you in the conversation. Convert imperial units before sending.
Show child attributes
Show child attributes
Example:
{
"gender": "female",
"age": 34,
"height_cm": 168,
"weight_kg": 61,
"body_shape": { "stomach": "medium", "hips": "wide" }
}
Where the profile was created.
Available options:
conversation, website_questionnaire, body_scan 