Sitzung initialisieren
Initialisieren Sie eine Product Recommendation API-Sitzung, um eine Device-ID und Session-ID zu erhalten, bevor Sie andere Empfehlungs-Endpoints aufrufen.
init-API auf. Der Initialisierungsprozess akzeptiert den aktuellen Benutzeridentifikator und fordert die Projekteinstellungen sowie die Benutzereinstellungen an.
Wann initialisieren
Je nach Plattform gibt es unterschiedliche Anforderungen, wann Sieinit ausführen müssen:
- cURL: Initialisieren Sie bei jedem Rendern der Seite.
- Web: Initialisieren Sie bei jedem Öffnen der Seite (einschließlich Single-Page-Anwendungen).
- iOS oder Android: Initialisieren Sie bei jedem Start der Anwendung.
init ohne Device-ID auf, um eine zu generieren. Für die Backend-Empfehlungslogik mit Kameleoon Web Experimentation rufen Sie diese API auf und speichern Sie die IDs im Cookie KameleoonProducts_session_code für sid und KameleoonProducts_device_id für did.
Abfrageparameter
sid erforderlich ist, fügen Sie ihn bei der ersten Initialisierung nicht hinzu, da das System ihn generiert und in der Antwort zurückgibt (als seance).Sobald die sid generiert ist, verwenden Sie die vom System generierte sid für Anfragen innerhalb der aktuellen Sitzung.Antwort
Abfrageparameter
Store Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.
A device ID. If a device ID already exists, specify it here. If you don't specify a did, the API generates a new one. Use this generated ID as the device ID for all future requests.
A session ID is a temporary identifier assigned to the user for the current session. Do not include sid on the first init request; Kameleoon generates and returns it (as seance) in the response. If a sid is specified and does not exist in the system, an error occurs.
Antwort
Session initialized. Verified against a live response on 2026-09-24; fields below reflect what the API actually returns, which is more than the did/seance pair described in the endpoint's prose.
The device ID. Store this for use on subsequent requests.
The generated session ID (sid). Use it for requests within the current session.
The shop's default currency symbol.
Whether the email collector feature is enabled for this shop.
Whether an email address is already associated with this session.
Whether product recommendations are enabled for this shop.
Whether recommendation blocks lazy-load on this shop.
Whether Kameleoon automatically injects CSS for recommendation blocks.
The CMS/platform identifier configured for this shop, if any.
Custom JavaScript snippets configured for this shop in the Kameleoon app, injected alongside recommendation blocks.
The shop's Search service configuration.