セッションの初期化
他のレコメンデーションエンドポイントを呼び出す前に、Product Recommendation API のセッションを初期化してデバイス ID とセッション ID を取得します。
init API を呼び出します。初期化プロセスは現在のユーザー識別子を受け入れ、プロジェクト設定とユーザー設定をリクエストします。
いつ初期化するか
プラットフォームによって、init を実行する必要があるタイミングの要件が異なります。
- cURL: ページがレンダリングされるたびに初期化します。
- Web: ページが開かれるたびに初期化します(シングルページアプリケーションを含む)。
- iOS または Android: アプリケーションが起動するたびに初期化します。
init メソッドを呼び出します。Kameleoon Web Experimentation を使用するバックエンドレコメンデーションロジックの場合は、この API を呼び出し、ID を sid 用の KameleoonProducts_session_code クッキーと did 用の KameleoonProducts_device_id クッキーに保存します。
クエリパラメーター
sid パラメーターは必須ですが、最初の初期化時には追加しないでください。システムがそれを生成し、レスポンス(seance として)で返します。生成後は、現在のセッション内のリクエストにはシステムが生成した sid を使用してください。レスポンス
クエリパラメータ
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.
レスポンス
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.