- Connect Kameleoon with Git repositories to manage variation code.
- Design custom dashboards populated with real-time experiment results.
- Automate the creation of goals and segments across multiple projects.
Contact the Kameleoon team to request an enhancement to the Automation API. Kameleoon appreciates your feedback and can quickly add existing UI features to the API.
Tutorials
Create an experiment
This tutorial provides step-by-step instructions for performing key tasks on the Kameleoon platform. You will learn how to:- Create a new experiment
- Push and modify JavaScript code in a variation
- Create a new segment
- Create a new goal
- Update and launch an experiment
Retrieve experiment results
After you launch an experiment, it generates results that provide insights into performance. Learn how to request results and identify the winning variation in the Retrieving Experiments Results tutorial.Authentication
The Automation API uses the OAuth 2.0 framework for authorization. Kameleoon supports two primary flows depending on your use case:- Client credentials flow: Use this flow if you are a Kameleoon customer using the API for internal purposes. This flow allows you to programmatically manage your own account and web properties.
- Authorization code flow: Use this flow if you are a technology partner integrating an app with Kameleoon. This flow allows you to securely access data on behalf of other Kameleoon users.
Client credentials flow
The Client credentials flow uses the fewest steps of the two authentication methods. To use this flow, exchange your client credentials for an access token.1. Obtain an access token
Send a POST request to the token endpoint with your credentials.curl
access_token:
2. Access the API
Include the access token as a Bearer token in theAuthorization HTTP header of your requests.
curl
- Access tokens remain valid for 2 hours by default.
- The Client credentials flow doesn’t use refresh tokens.
- You must use HTTPS for all API requests. Requests made over plain HTTP will fail.
Authorization code flow
The Authorization Code flow allows third-party developers to integrate their apps with Kameleoon data. You must obtain explicit permission from a user to access their account resources.Contact your Kameleoon Technical Account Manager to request an OAuth app. You must provide a redirect URL for your app. Kameleoon will then provide a
client_id and client_secret.1. Redirect the user for authorization
Redirect users from your app to the authorization URL:2. Obtain access and refresh tokens
Exchange the authorization code for tokens. Base64 encode theclient_id:client_secret string and include it in the Authorization: Basic header.
curl
3. Refresh an expired token
To obtain a new access token without re-authorizing the user:curl
Rate limiting
Rate limiting for the Automation API occurs per user access token. Kameleoon uses two rate-limiting windows:- 10-second interval: Up to 50 requests.
- 1-hour interval: Up to 1,000 requests.
HTTP 429 Too Many Requests error. To minimize rate limiting:
- Implement caching: Store API responses locally and avoid calling the API on every page load.
- Use the Data API: If your app requires real-time tracking at scale, use the Data API.
HTTP status codes
Query parameters
For endpoints that retrieve multiple objects, use query parameters to paginate, filter, or sort data.Pagination
Queries return 20 items per page by default (maximum 200). UseperPage=-1 to retrieve the maximum limit.
Filtering
You must percent-encode filters when sending them in a URL. Example:filter=[{"field":"name","operator":"EQUAL","parameters":["Test"]}]