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 runinit:
- 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.
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.