Skip to main content
GET
/
key-moments
Get all key moments
curl --request GET \
  --url https://api.kameleoon.com/key-moments \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.kameleoon.com/key-moments"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.kameleoon.com/key-moments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kameleoon.com/key-moments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.kameleoon.com/key-moments"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.kameleoon.com/key-moments")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.kameleoon.com/key-moments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
[
  {
    "name": "My Key Moment",
    "siteId": 8372,
    "audienceTracking": true,
    "audienceTrackingEditable": true,
    "conditionDataList": [
      {
        "id": 123,
        "isConditionBlock": true,
        "parentId": 123,
        "targetingCondition": {
          "weight": 1,
          "count": 123,
          "include": true,
          "htmlDescription": "<string>",
          "id": 123
        }
      }
    ],
    "conditionDataTree": {
      "targetingType": "<string>",
      "conditionData": [
        "<unknown>"
      ],
      "isConditionBlock": true
    },
    "conditionsData": {
      "firstLevel": [
        {
          "conditions": [
            {
              "weight": 1,
              "count": 123,
              "include": true,
              "htmlDescription": "<string>",
              "id": 123
            }
          ],
          "orOperators": [
            true
          ]
        }
      ],
      "firstLevelOrOperators": [
        true
      ]
    },
    "createdBy": 123,
    "dateCreated": "2023-11-07T05:31:56Z",
    "dateModified": "2023-11-07T05:31:56Z",
    "description": "The key moment is for new A/B tests",
    "id": 123,
    "isFavorite": true,
    "links": [
      {
        "domainId": 123,
        "domainStatus": "<string>"
      }
    ],
    "userVisible": true
  }
]
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

paramsIO
Request params · object
required

Response

OK

name
string
required

Name of the key moment

Example:

"My Key Moment"

siteId
integer<int64>
required

Unique Id of the site where the key moment was, or will be created.

Example:

8372

audienceTracking
boolean

Indicates if the key moment is used for tracking audience

audienceTrackingEditable
boolean
read-only

Indicates if audienceTracking can be enabled or disabled. In some cases, audienceTracking cannot be disabled. E.g. When a key moment has predictive conditions, audience will be tracked by default.

conditionDataList
Conditions data node · object[]

Conditions upon which visitors will be included in the key moment in list form

conditionDataTree
Conditions data level · object

Conditions by which visitors will be segmented in tree form

conditionsData
Conditions data · object

Conditions according to which visitors will be segmented

createdBy
integer<int64>
read-only

Account Id of the key moment creator

dateCreated
string<date-time>
read-only

Date the key moment was created

dateModified
string<date-time>
read-only

Date the key moment was modified

description
string

Description of the key moment

Example:

"The key moment is for new A/B tests"

id
integer<int64>
read-only

Unique Id of the key moment

isFavorite
boolean

Indicates whether the key moment is a favorite

List of links to related entities.This is an optional field that is included in the request body

userVisible
boolean

Indicates whether the key moment is hidden from the user.