Skip to main content
Before using any other API method in the Product Recommendation API, call the init API. The initialization process accepts the current user identifier and requests the project settings and user preferences.

HTTP Request

When to initialize

Depending on your platform, there are different requirements for when you need to run init:
  • cURL: Initialize each time the page is rendered.
  • Web: Initialize each time the page is opened (including single-page applications).
  • iOS or Android: Initialize each time the application launches.
On the first launch on a new device, a device identifier is missing. Call the init method without a device ID to generate one. For backend recommendation logic with Kameleoon Web Experimentation, call this API and store the IDs in the KameleoonProducts_session_code cookie for sid and KameleoonProducts_device_id for did.

Query parameters

While the sid parameter is required, do not add it during the first initialization, as the system generates it and returns it in the response (as seance).Once generated, use the system-generated sid for requests within the current session.