Produktempfehlungen abrufen
curl --request GET \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/endpoint', 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://api.example.com/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/endpoint"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/endpoint")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyEmpfehlen
Produktempfehlungen abrufen
Erhalten Sie personalisierte Produktempfehlungen von der Kameleoon Product Recommendation API mithilfe von Empfehlungscodes.
GET
/
endpoint
Produktempfehlungen abrufen
curl --request GET \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/endpoint', 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://api.example.com/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/endpoint"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/endpoint")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyDieser Endpoint ruft Produktempfehlungen ab.
Anfrage
GET https://api.products.kameleoon.com/recommend/{%recommender_code%}
Abfrageparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
did | String | True | Device-ID. Holen Sie diese ID aus dem Cookie KameleoonProducts_device_id. Rufen Sie sie vor dem Aufruf dieses Endpoints aus dem Backend ab. Geben Sie did nur an, wenn Sie Filter oder Algorithmen verwenden, die auf historischen Gerätedaten basieren, wie zum Beispiel “Recently Viewed” oder “Recommended for You.” |
shop_id | String | True | Store Key. Sie finden ihn in Recommendations > Settings > Store settings in der Kameleoon App. Kontaktieren Sie Ihren Customer Success Manager, falls erforderlich, um den Schlüssel zu erhalten. |
sid | String | True | Temporäre Benutzersitzungs-ID. Holen Sie diese ID aus dem Cookie KameleoonProducts_session_code. Rufen Sie sie vor dem Aufruf dieses Endpoints aus dem Backend ab. Geben Sie sid nur an, wenn Sie Filter oder Algorithmen verwenden, die auf historischen Benutzerdaten basieren, wie zum Beispiel “Recently Viewed” oder “Recommended for You.” |
recommender_code | String | True | ID des Produktempfehlungsblocks. Den recommender_code finden Sie in der Block-Verwaltungs-UI. |
resize_image | Integer | Optional | Bildgröße (px) für die Größenänderung. Unterstützte Werte: 120, 140, 160, 180, 200, 220. |
extended | Integer or empty | Optional | Fügt erweiterte Informationen für empfohlene Produkte hinzu. Bei 1 gibt die API alle Produktinformationen zurück. Wenn leer, gibt die API nur Produkt-IDs zurück. |
with_locations | Boolean | False | Wenn true und der Parameter extended ebenfalls true ist, enthält die Antwort location_ids für alle Verfügbarkeitsorte. Wenn extended fehlt oder false ist, ignoriert die API with_locations und verwendet standardmäßig false. |
Antwort
| Name | Typ | Beschreibung |
|---|---|---|
html | string | HTML-Code für den Produktblock. Passen Sie die HTML-Vorlage im persönlichen Kameleoon-Konto an. |
title | string | Blocktitel. Entspricht dem Wert des “Action”-Elements in den Blockregeln. |
recommends | array | Liste der Produkt-IDs. |
id | number | Eindeutige Blockkennung. Entspricht der Block-ID im persönlichen Kameleoon-Konto. |
War diese Seite hilfreich?
⌘I