Rest API (Server-Side API)

3

min

quiz

Welcome to Kameleoon API! This API will allow you to use every entity of Kameleoon application inside your own application. Find the full list of the supported functionalities on this page.

Rest Auth

Get Token

Create temporary token using username and password from request body. Expiration in 1 hour.

/k-api/authorization
curl -k -X POST \
-H "Content-Type: application/json" \
-d '{username: a@a.com, password: 123456qwerty}' \
"https://api.kameleoon.com/k-api/authorization" \

Parameter

Field Description
username Your user name.
password Your user password.
HTTP/1.1 200 OK
{
     "success": true,
     "errors": [],
     "result": {
         "token": "ABCDEF123456789",
         "expiration_in": 3600
     }
}

Site

Create Site

Create a site with default values.

https://api.kameleeon.com/k-api/site
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
    "name":"site name",
    "url":"https://www.example.com"
}' \
"https://api.kameleoon.com/k-api/site" \

Parameter

Field Type Description
url String The site url. Must start from http:// or https://.
name OPTIONAL String The site name.
HTTP/1.1 200 OK
{
		"result": {
			"includeJQuery": false,
			"name": "site name",
			"id": 2,
			"googleAnalyticsProfile": null,
			"googleAnalyticsMainGoal": "E_COMMERCE",
			"url": "https://www.example.com"
		},
		"success": true,
		"errors": []
}

Get Site

Get the informations of a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/site/1" \
HTTP/1.1 200 OK
{
		"result": {
			"includeJQuery": false,
			"name": "a@a.com",
			"id": 1,
			"googleAnalyticsProfile": null,
			"googleAnalyticsMainGoal": "E_COMMERCE",
			"url": "http://www.example.com"
		},
		"success": true,
		"errors": []
}

Get list of sites

Get the list of customer sites.

https://api.kameleeon.com/k-api/site
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/site" \
HTTP/1.1 200 OK
{
		"result": {
			"sites": [
				{
					"includeJQuery": false,
					"name": "a@a.com",
					"id": 1,
					"googleAnalyticsProfile": null,
					"googleAnalyticsMainGoal": "E_COMMERCE",
					"url": "http://www.example.com"
				}
			]
		},
		"success": true,
		"errors": []
}

Update Site

Update the information of a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
    "name":"new site name",
    "url":"https://www.new-example.com",
    "includeJQuery":false
}' \
"https://api.kameleoon.com/k-api/site/1" \

Parameter

Field Type Description
name OPTIONAL String The site name.
url OPTIONAL String The site url. Must start from http:// or https://.
includeJQuery OPTIONAL Boolean Set true if you want to include JQuery on your site.
googleAnalyticsProfile OPTIONAL String Google analytics profile code.
googleAnalyticsMainGoal OPTIONAL String Google analytics main goal code.
HTTP/1.1 200 OK
{
		"result": {
			"includeJQuery": false,
			"name": "new site name",
			"id": 1,
			"googleAnalyticsProfile": null,
			"googleAnalyticsMainGoal": "E_COMMERCE",
			"url": "https://www.new-example.com"
		},
		"success": true,
		"errors": []
}

Delete Site

Delete a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Disable Site

Disable kameleoon.js on a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id/disable
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/disable" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Enable Site

Enable kameleoon.js on a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id/enable
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/enable" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Experiment

Create Experiment

Create a experiment on a site with default values. Site ID is required in the URL.

https://api.kameleoon.com/k-api/experiment?siteId=:siteId
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
		"name":"experiment name"
}' \
"https://api.kameleoon.com/k-api/experiment?siteId=1" \

Parameter

Field Type Description
name OPTIONAL String Name of the Experiment.
HTTP/1.1 200 OK
{
		"result": {
			"goalId": null,
			"name": "experiment name",
			"siteId": 14794,
			"variationsId": "[]",
			"id": 27856,
			"experimentStatus": "draft"
		},
		"success": true,
		"errors": []
	}

Get Experiment

Get the information of an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1" \
HTTP/1.1 200 OK
{
		"result": {
			"targetingSegmentId": 1,
			"reportingTools": {
				"repotingToolsValues": [
					"[Newsletter]"
				],
				"repotingToolsNames": [
					"kameleoonTracking"
				]
			},
			"deviations": {
				"1": 0.3,
				"reference": 0.7
			},
			"scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
			"scheduleCronStart": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
			"mainGoal": "22560",
			"variations": [
				1,
				2
			],
			"name": "Test 45 (copy of Test 35)",
			"siteId": 1,
			"id": 1,
			"experimentStatus": "DRAFT",
			"goals": [
				1
			]
		},
		"success": true,
		"errors": []
	}

Get list of Experiments

Get the list of experiments for a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/experiment?:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/experiment?siteId=1" \
    HTTP/1.1 200 OK
    {
    		"result": {
    			"experiments": [
					{
    					"targetingSegmentId": 1,
    					"reportingTools": {
    						"repotingToolsValues": [
    							"[Newsletter]"
    						],
    						"repotingToolsNames": [
    							"kameleoonTracking"
    						]
    					},
    					"deviations": {
    						"1": 0.3,
    						"reference": 0.7
    					},
    					"scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
    					"scheduleCronStart": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
    					"mainGoal": "22560",
    					"variations": [
    						1,
    						2
    					],
    					"name": "Test 45 (copy of Test 35)",
    					"siteId": 1,
    					"id": 1,
    					"experimentStatus": "DRAFT",
    					"goals": [
    						1
    					]
    				}
    			]
    		},
    		"success": true,
    		"errors": []
    	}

Update Experiment

Update the information of an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-d '{
		"siteId":14797,
		"experimentStatus":"PAUSE"
}' \
"https://api.kameleoon.com/k-api/experiment/1" \

Parameter

Field Type Description
siteId String id of the Site associated with Experiment.
name String new Experiment name.
experimentStatus String new Experiment status.

Allowed values: {ACTIVEPAUSEENDED}

segmentId OPTIONAL String Id of Targeting Segment to bind with Experiment.
deviation OPTIONAL JsonObject Deviation as json.
reference Float Part of audience go by main reference.

Ordre de grandeur : 0..1

:variationId Float Part of audience go by variation with id=variationId.

Ordre de grandeur : 0..1

HTTP/1.1 200 OK
{
		"result": {
			"targetingSegmentId": 45667,
			"reportingTools": {
				"repotingToolsValues": [
					[
						"Engagement"
					]
				],
				"repotingToolsNames": [
					"kameleoonTracking"
				]
			},
			"deviations": {
				"115466": 0.32,
				"reference": 0.68
			},
			"scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
			"scheduleCronStart": "",
			"mainGoal": "22752",
			"variations": [],
			"name": "Test 1",
			"siteId": 14797,
			"id": 27860,
			"experimentStatus": "PAUSE",
			"goals": [
				22752
			]
		},
		"success": true,
		"errors": []
	}

Duplicate Experiment

Duplicate an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1" \
HTTP/1.1 200 OK
{
		"result": {
		     "targetingSegmentId": 1,
		     "reportingTools": {
		     	"repotingToolsValues": [],
		     	"repotingToolsNames": []
		     },
		     "deviations": {},
		     "scheduleCronStop": "",
		     "scheduleCronStart": "",
		     "variations": [],
		     "name": "Test 2 (copy of Test 1)",
		     "siteId": 1,
		     "id": 1,
		     "experimentStatus": "DRAFT",
		     "goals": []
		},
		"success": true,
		"errors": []
	}

Create/Update Experiment Schedule

Create or Update (if experiment not started yet) a schedule for an experiment. You must specify schedule either as cron or as date. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id/schedule
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
		"date": {
			"start": {
		 		"weekday": [1,2,3,4,5],
		 		"hour": [8]
			},
			"stop": {
		 		"weekday": [1,2,3,4,5],
		 		"hour": [22]
		 	}
		}
}' \
"https://api.kameleoon.com/k-api/experiment/1/schedule" \

Parameter

Field Type Description
cron OPTIONAL JsonObject Start and stop date as cron expression.
start String Start experiment schedule.
stop OPTIONAL String Stop experiment schedule.
date OPTIONAL JsonObject Start and stop date as JsonArray.
start JsonObject Start experiment schedule.
minute OPTIONAL JsonArray Start experiment since minute.

Default value: 0

Ordre de grandeur : 0-59

hour OPTIONAL JsonArray Start experiment since hour.

Default value: every

Ordre de grandeur : 0-23

day OPTIONAL JsonArray Start experiment since day.

Default value: every

Ordre de grandeur : 1-31

month OPTIONAL JsonArray Start experiment since month.

Default value: every

Ordre de grandeur : 1-12

weekday OPTIONAL JsonArray Start experiment since weekday. Sunday = 1.

Default value: every

Ordre de grandeur : 1-7

year OPTIONAL JsonArray Start experiment since year.

Default value: every

stop OPTIONAL JsonObject Stop experiment schedule.
minute OPTIONAL JsonArray Stop experiment since minute.

Default value: 0

Ordre de grandeur : 0-59

hour OPTIONAL JsonArray Stop experiment since hour.

Default value: every

Ordre de grandeur : 0-23

day OPTIONAL JsonArray Stop experiment since day.

Default value: every

Ordre de grandeur : 1-31

month OPTIONAL JsonArray Stop experiment since month.

Default value: every

Ordre de grandeur : 1-12

weekday OPTIONAL JsonArray Stop experiment since weekday. Sunday = 1.

Default value: every

Ordre de grandeur : 1-7

year OPTIONAL JsonArray Stop experiment since year.

Default value: every

HTTP/1.1 200 OK
{
		"result": {
			"schedule": {
				"start": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
				"stop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016"
			}
		},
		"success": true,
		"errors": []
	}

Experiment Results

Get the results of an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id/result?interval=:interval
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1/result?interval=hour" \

Parameter

Field Type Description
interval OPTIONAL String Interval for getting results.

Default value: DAY

Allowed values: HOURDAYWEEKMONTHYEAR

Success 200

Field Type Description
goals JsonArray List of Goals.
goalId JsonObject Contains list of variations.
id Number Variation id. “reference” – case for absence of any variations. “winner” – the best variation.
name String The variation name.
trustRate Number The trust rate.
improvement Number Relative improvement over absence of any variations, computed as the ratio of conversionRate values minus 1.
conversionRate Number Conversion rate, computed as conversions/visitors for this variation.
visits Number Number of site visitors for this variation.
allConversions Number All conversions during the test.
convertedVisits Number Visits who have converted the goal.
HTTP/1.1 200 OK
{
		"result": {
			"goals": [
				"20292": {
					"111643": "{name=MENU HORIZONTAL (A), id=111643, Improvement=+9.22%, StatisticalSignificance=100.00%, allConversions=6,369, visits=16,551, convertedVisits=2,600, ConversionRate=15.71%}",
					"112435": "{name=MENU HORIZONTAL Fusion Musique (B), id=112435, Improvement=+6.58%, StatisticalSignificance=99.80%, allConversions=5,944, visits=16,517, convertedVisits=2,532, ConversionRate=15.33%}",
					"112436": "{name=MENU HORIZONTAL Fusion Son (C), id=112436, Improvement=+5.62%, StatisticalSignificance=99.31%, allConversions=6,129, visits=16,549, convertedVisits=2,514, ConversionRate=15.19%}",
					"112437": "{name=MENU HORIZONTAL Fusion Musique et Son (D), id=112437, Improvement=+8.23%, StatisticalSignificance=99.98%, allConversions=6,108, visits=16,510, convertedVisits=2,570, ConversionRate=15.57%}",
					"112920": "{name=Référence Bis Sans Lien Niveau 1, id=112920, Improvement=-100.00%, StatisticalSignificance=--, allConversions=0, visits=0, convertedVisits=0, ConversionRate=0.00%}",
					"reference": "{name=reference, id=reference, Improvement=+0.00%, StatisticalSignificance=--, allConversions=13,659, visits=40,930, convertedVisits=5,887, ConversionRate=14.38%}",
					"winner": "{name=MENU HORIZONTAL (A), id=111643, Improvement=+9.22%, StatisticalSignificance=100.00%, allConversions=6,369, visits=16,551, convertedVisits=2,600, ConversionRate=15.71%}"
				}
			]
		}
		"success": true,
		"errors": []
	}

Export Experiment Results

Export experiment results to csv file.

https://api.kameleeon.com/k-api/experiment/:id/export?interval=hour
wget \
--header="X-Auth-Key:2MSO9VFIUSPI6YU" \
--header="X-Auth-Email:a@a.com" \
https://api.kameleoon.com/k-api/experiment/1/export?interval=hour \
--no-check-certificate \
--content-disposition \

Parameter

Field Type Description
interval OPTIONAL String Interval for getting results.

Default value: DAY

Allowed values: HOURDAYWEEKMONTHYEAR

Delete Experiment

Delete an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/:id" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}

Variation

Create Variation

Create a variation on an experiment. Experiment ID is required in the URL.

/k-api/experiment/:id/variation
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"variation name",
     "jsCode":"variation js",
     "cssCode":"variation css"
}'
"https://api.kameleoon.com/k-api/experiment/1/variation" \

Parameter

Field Type Description
name String The variation name.
jsCode OPTIONAL String The variation javascript code.
cssCode OPTIONAL String The variation css style.
waitDOMReady OPTIONAL Boolean Is js code applied after DOM ready.

Default value: true

HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": "variation css",
			"waitDOMReady": true,
			"name": "variation name",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": "variation js"
		},
		"success": true,
		"errors": []
}

Get Variation

Get the information of a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/variation/1" \
HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": "variation css",
			"waitDOMReady": true,
			"name": "variation name",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": "variation js"
		},
		"success": true,
		"errors": []
}

Get list of Variations

Get the list of variations for an experiment. Experiment ID is required in the URL.

/k-api/experiment/:id/variations
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1/variations" \
HTTP/1.1 200 OK
{
		"result": {
			"variations": [
				{
					"customCssCode": "variation css",
					"waitDOMReady": true,
					"name": "variation name",
					"id": 1,
					"attachedExperimentId": 1,
					"javaScriptCode": "variation js"
				}
			],
		},
		"success": true,
		"errors": []
}

Update Variation

Update the information of a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "jsCode":"variation js new",
     "cssCode":"variation css new"
}' \
"https://api.kameleoon.com/k-api/variation/1" \

Parameter

Field Type Description
jsCode OPTIONAL String New javascript code for variation.
cssCode OPTIONAL String New css style for variation.
waitDOMReady OPTIONAL Boolean Set true if code applied after DOM ready.

Default value: true

HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": "variation css new",
			"waitDOMReady": true,
			"name": "variation name",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": "variation js new"
		},
		"success": true,
		"errors": []
}

Duplicate Variation

Duplicate a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/variation/1" \
HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": null,
			"waitDOMReady": true,
			"name": "Copy of (Variation 1)",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": null
		},
		"success": true,
		"errors": []
}

Delete Variation

Delete a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/variation/1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Goal

Create Goal

Create a goal on a site. Site ID is required in the URL.

/k-api/site/:id/goal
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"goal name",
     "goalType":"URL"
}'
"https://api.kameleoon.com/k-api/site/1/goal" \

Parameter

Field Type Description
name String Goal name.
goalType String Type of Goal.

Allowed values: ENGAGEMENTCLICKURLPAGE_VIEWSTIME_SPENTCUSTOM

HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "URL",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": null,
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
}

Get Goal

Get a goal. Goal ID and Site ID are required in the URL.

/k-api/goal/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/goal/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "URL",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": null,
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
}

Get list of Site Goals

Get the list of goals associated with a site. Site ID is required in the URL.

/k-api/site/:id/goals
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/goals" \
HTTP/1.1 200 OK
{
		"result": {
			"mainPersonalizationGoal": null,
			"goals": [
				{
	    			"piwikEventTracking": true,
	    			"adobeOmnitureEventTracking": true,
	    			"kissMetricsEventTracking": true,
	    			"comScoreEventTracking": true,
	    			"matchType": "null",
	    			"attachedGoalName": null,
	    			"masterGoalId": null,
 				"multipleConversions": false,
	    			"type": "URL",
	    			"heatMapEventTracking": true,
	    			"action": null,
	    			"experimentId": null,
	    			"selector": null,
	    			"id": 1,
	    			"eulerianEventTracking": true,
	    			"crazyEggEventTracking": true,
	   			 	"mentalistWeight": 0,
	    			"timeSpent": null,
	   			 	"attachedGoalId": null,
	   			 	"universalAnalyticsEventTracking": true,
	    			"url": null,
	   			 	"googleAnalyticsEventTracking": true,
	    			"pageViews": null,
	    			"name": null,
	    			"attached": false,
	    			"webtrendsEventTracking": true,
		   			"reportingScriptEventTracking": true,
		   			"category": null,
	    			"atInternetEventTracking": true
				}
			]
		},
		"success": true,
		"errors": []
	}

Get list of Experiment Goals

Get the list of goals associated with an experiment. Experiment ID is required in the URL.

/k-api/experiment/:id/goal
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"goal name",
     "goalType":"URL"
}'
"https://api.kameleoon.com/k-api/experiment/1/goal" \

Parameter

Field Type Description
name String Goal name.
goalType String Type of Goal.

Allowed values: ENGAGEMENTCLICKURLPAGE_VIEWSTIME_SPENTCUSTOM

HTTP/1.1 200 OK
{
		"result": {
			"mainGoal": {
				"piwikEventTracking": true,
				"adobeOmnitureEventTracking": true,
				"kissMetricsEventTracking": true,
				"comScoreEventTracking": true,
				"matchType": "null",
				"attachedGoalName": null,
				"masterGoalId": 22751,
				"multipleConversions": false,
				"type": "ENGAGEMENT",
				"heatMapEventTracking": true,
				"action": null,
				"experimentId": 1,
				"selector": null,
				"id": 2,
				"eulerianEventTracking": true,
				"crazyEggEventTracking": true,
				"mentalistWeight": 0,
				"timeSpent": null,
				"attachedGoalId": null,
				"universalAnalyticsEventTracking": true,
				"url": null,
				"googleAnalyticsEventTracking": true,
				"pageViews": null,
				"name": "Engagement",
				"attached": false,
				"webtrendsEventTracking": true,
				"reportingScriptEventTracking": true,
				"category": null,
				"atInternetEventTracking": true
			}
			"goals": [
				{
	    			"piwikEventTracking": true,
	    			"adobeOmnitureEventTracking": true,
	    			"kissMetricsEventTracking": true,
	    			"comScoreEventTracking": true,
	    			"matchType": "null",
	    			"attachedGoalName": null,
	    			"masterGoalId": null,
 				"multipleConversions": false,
	    			"type": "URL",
	    			"heatMapEventTracking": true,
	    			"action": null,
	    			"experimentId": null,
	    			"selector": null,
	    			"id": 1,
	    			"eulerianEventTracking": true,
	    			"crazyEggEventTracking": true,
	   			 	"mentalistWeight": 0,
	    			"timeSpent": null,
	   			 	"attachedGoalId": null,
	   			 	"universalAnalyticsEventTracking": true,
	    			"url": null,
	   			 	"googleAnalyticsEventTracking": true,
	    			"pageViews": null,
	    			"name": null,
	    			"attached": false,
	    			"webtrendsEventTracking": true,
		   			"reportingScriptEventTracking": true,
		   			"category": null,
	    			"atInternetEventTracking": true
				}
			]
		},
		"success": true,
		"errors": []
	}

Update Goal

Update the information of a goal. Goal ID is required in the URL.

/k-api/goal/:id?siteId=:siteId
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"goal name new",
     "goalType":"TIME_SPENT"
}'
"https://api.kameleoon.com/k-api/goal/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "TIME_SPENT",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": "goal name new,
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
	}

Duplicate Goal

Duplicate a goal. Goal ID and Site ID are required in the URL.

/k-api/goal/:id?siteId=1
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/goal/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "URL",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": "Copy of (Goal 1 name)",
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
}

Delete Goal

Delete a goal. Goal ID and Site ID are required in the URL.

/k-api/goal/:id?siteId=:siteId
curl -k -X Delete \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/goal/1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}

Targeting segment

Create TargetingSegment

Create a targeting segment on a site. Site id is required in the URL.

/k-artiart/site/:id/segment
curl -k \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "siteId":1,
     "name":"segment name",
     "description":"segment description",
     "conditionsData": {
         "firstLevelOrOperators": [
         	true,
         	false,
         	true
         ],
         "secondLevel": [
         	{
         		"orOperators": [
         			false
         	    ],
       			"conditions": [
       				{
       					"targetingType": "DEVICE_TYPE",
       					"device": "DESKTOP",
       					"include": "true",
       					"weight": 1
       				},
       				{
       					"targetingType": "BROWSER_LANGUAGE",
       					"language": "af",
       					"include": "true",
       					"weight": 1
       				}
       			]
       		},
       		{
       			"orOperators": [
       				false
       			],
       			"conditions": [
       				{
       					"targetingType": "PAGE_VIEWS",
       					"pageCount": "10",
       					"countOp": "GREATER",
       					"include": "true",
       					"weight": 1
       				},
       				{
       					"targetingType": "ORIGIN_TYPE",
       					"trafficType": "DIRECT",
       					"include": "true",
       					"weight": 1
       				}
       			]
       		},
       		{
       			"orOperators": [],
       			"conditions": [
       				{
       					"targetingType": "SEARCH_KEYWORD",
       					"keyword": "search+word",
       					"matchType": "EXACT",
       					"include": "true",
       					"weight": 1
       				}
       			]
       		}
       	]
     }
}' \
"https://api.kameleoon.com/k-api/site/1/segment" \

Parameter

Field Type Description
name String Targeting segment name.
description OPTIONAL String Targeting segment description.
conditionsData OPTIONAL JsonObject Targeting segment conditions.

conditionsData

Field Type Description
firstLevelOrOperators OPTIONAL JsonArray Array of booleans (“or”=true, “and”=false) for binding secondLevel outer conditions.
secondLevel OPTIONAL JsonArray Array of JsonObjects with outer conditions.

secondLevel

Field Type Description
orOperators OPTIONAL JsonArray Boolean (“or”=true, “and”=false) for binding secondLevel inner conditions.
conditions OPTIONAL JsonArray JsonArray with secondLevel inner conditions.

conditions

Field Type Description
targetingType String Targeting condition type. According to this field it’s necessary to add some additional fields as shown below!

Allowed values: PAGE_URLPAGE_TITLELANDING_PAGEORIGINORIGIN_TYPESEARCH_KEYWORDNEW_VISITORSBROWSER_LANGUAGEGEOLOCATIONDEVICE_TYPEPREVIOUS_PAGEPAGE_VIEWSFIRST_VISITLAST_VISITACTIVE_SESSIONTIME_SINCE_PAGE_LOADSAME_DAY_VISITSVISITSMOUSE_OUTCONVERSIONSINTERNAL_SEARCH_KEYWORDSTABS_ON_SITEWEATHERDAY_OF_WEEKTIME_RANGEHOUR_MINUTE_RANGEJS_CODECOOKIEEVENTBROWSEROPERATING_SYSTEMDOM_ELEMENT

PAGE_URL

Field Type Description
url String URL template.
matchType OPTIONAL String Accordance between requested URL and URL template.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

PAGE_TITLE

Field Type Description
title String Title template.
matchType OPTIONAL String Accordance between page title and title template.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

LANDING_PAGE

Field Type Description
url String Landing URL template.
matchType OPTIONAL String Accordance between requested URL and landing URL template.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

ORIGIN

Field Type Description
url String Referring website URL template.
matchType OPTIONAL String Accordance between visitors origin URL and referring website URL template.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

ORIGIN_TYPE

Field Type Description
trafficType String Traffic type.

Allowed values: SEOSEMAFFILIATIONEMAILDIRECT

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

SEARCH_KEYWORD

Field Type Description
keyword String AdWords search keywords.
matchType OPTIONAL String Accordance between visitors search word and keyword.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

NEW_VISITORS

Field Type Description
visitorsType String New or returning visitors.

Allowed values: NEWRETURNING

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

BROWSER_LANGUAGE

Field Type Description
language String Browser language code in ISO 639-1.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

GEOLOCATION

Field Type Description
country String IP location country.
region OPTIONAL String IP location region.
city OPTIONAL String IP location city.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

DEVICE_TYPE

Field Type Description
device String Device type.

Allowed values: DESKTOPTABLETPHONE

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

PREVIOUS_PAGE

Field Type Description
url String Previous page URL template.
matchType OPTIONAL String Accordance between previous page URL and URL template.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

PAGE_VIEWS

Field Type Description
pageCount Integer Number of page views.
countOp String Operand for pageCount.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

FIRST_VISIT

Field Type Description
dayCount Integer Days elapsed since first visit.
countOp String Operand for dayCount.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

LAST_VISIT

Field Type Description
dayCount Integer Days elapsed since last visit .
countOp String Operand for dayCount.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

ACTIVE_SESSION

Field Type Description
secondCount Integer Seconds elapsed since session became active.
countOp String Operand for secondCount.

Allowed values: LOWERGREATER

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

TIME_SINCE_PAGE_LOAD

Field Type Description
secondCount Integer Seconds elapsed since page load.
countOp String Operand for secondCount.

Allowed values: LOWERGREATER

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

SAME_DAY_VISITS

Field Type Description
visitCount Integer Number of visits for day.
countOp String Operand for visitCount.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

VISITS

Field Type Description
visitCount Integer Total number of visits.
countOp String Operand for visitCount.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

MOUSE_OUT

Field Type Description
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

CONVERSIONS

Field Type Description
goal String Goal that have reached by visitors.

Allowed values: ANYENGAGEMENT:GOAL_ID

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

INTERNAL_SEARCH_KEYWORDS

Field Type Description
keyword String On site search keyword.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

TABS_ON_SITE

Field Type Description
tabCount Integer Number of tabs opened.
countOp String Operand for tabCount.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

DAY_OF_WEEK

Field Type Description
day String Weekday.

Allowed values: MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

TIME_RANGE

Field Type Description
since String Since date. Date format: dd/mm/yyyyThh:MM.
to String To date. Date format: dd/mm/yyyyThh:MM.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

HOUR_MINUTE_RANGE

Field Type Description
since String Since time. Time format: hh:MM.
to String To time. Time format: hh:MM.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

JS_CODE

Field Type Description
jsCode String Custom JavaScript condition.
applied OPTIONAL String Run js code after DOM ready or immediate?

Default value: DOM_READY

Allowed values: DOM_READYIMMEDIATE

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

COOKIE

Field Type Description
name String Browser cookie name template.
value OPTIONAL String Wait while DOM is ready.
matchType OPTIONAL String Accordance between visitors cookie name and cookie name template.

Default value: EXACT

Allowed values: EXACTCONTAINSREGULAR_EXPRESSION

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

EVENT

Field Type Description
event String Custom event.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

BROWSER

Field Type Description
browser String Browser.

Allowed values: CHROMEIEFIREFOXSAFARIOPERA

version Integer Browser version.
versionOp String Operand for version.

Allowed values: LOWERGREATEREQUAL

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

OPERATING_SYSTEM

Field Type Description
os String Operating system.

Allowed values: WINDOWSLINUXMAC_OSANDROIDIOS

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

DOM_ELEMENT

Field Type Description
elementType String Type of element on the page.

Allowed values: ANY_MODIFIEDSINGLE

elementValue OPTIONAL String Element on the page (id, class, …) if elementType is SINGLE.
weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

WEATHER

Field Type Description
weather String Weather in client place.

Allowed values: CLEARCLOUDYDRIZZLERAINTHUNDERSTORMHAILSNOWCALMBREEZEHIGH_WINDDISTURBEDHOTCOLDSETTING

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

REFERRERS

Field Type Description
referrer String The visitors referrer.

Allowed values: ANY_REFERRERGOOGLE_ADWORDSGOOGLE_SEARCHBING_SEARCHYAHOO_SEARCHBAIDU_SEARCH

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

INTERESTS

Field Type Description
interest String The visitor interests.

Allowed values: ANY:INTEREST_NAME

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

KEY_PAGES

Field Type Description
pages String Key pages that have visited visitors.

Allowed values: ANY:KEY_PAGES_NAME

weight OPTIONAL Integer More important conditions have greater values.

Default value: 1

isInclude OPTIONAL Boolean Is include if match this condition?

Default value: true

Get TargetingSegment

Get the information of a targeting segment. Segment id and siteId are required in the URL.

/k-api/segment/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/segment/1" \

Update TargetingSegment

The segment id and siteId are required in the URL. Only targeting conditions will be updated. For more description see ‘Create TargetingSegment’ section.

/k-api/segment/:id?siteId=:siteId
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"json name new",
     "description":"json description new",
     "conditionsData": {
         "secondLevel": [
             {
                 "conditions": [
                     {
                         "targetingType": "SEARCH_KEYWORD",
                         "keyword": "search+word+new",
                         "include": "true",
                         "weight": 1
                     }
                 ]
             }
         ]
     }
}' \
"https://api.kameleoon.com/k-api/segment/1?siteId=1" \

Parameter

Field Type Description
conditionsData JsonObject New targeting condition data.

Update TargetingSegment Condition

TargetingSegment id is required in the url. Search targetingCondition by targetingType and mandatory field for this targetingType and update conditions for founded targeting condition.

/k-api/condition/:id
curl -k \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
      "conditions": [
              {
       		    "targetingType": "DEVICE_TYPE",
       		    "oldValue": "MOBILE",
       			"device": "DESKTOP",
       			"include": "true",
       			"weight": 1
       		},
       		{
       			"targetingType": "BROWSER_LANGUAGE",
       		    "oldValue": "aa",
       			"language": "af",
       			"include": "true",
       			"weight": 1
       		}
      ]
}' \
"https://api.kameleoon.com/k-api/condition/1" \

Parameter

Field Type Description
conditions JsonArray Array of conditions to update.
targetingType String Condition TargetingType.
oldValue String Value for mandatory field for this targetingType (see Create TargetingSegment).

Delete TargetingSegment

Delete a targeting segment. Segment ID and Site ID are required in the URL.

/k-api/segment/:id?siteId=:siteId
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/segment/1" \

Parameter

Field Type Description
conditionsData JsonObject New targeting condition data.

List of TargetingSegment

Get the list of targeting segments for a site. Site ID is required in the URL.

/k-api/site/:id/segments
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/segments" \

Personalization

Create Personalization

Create a personalization on a site with default values. Site ID is required in the URL.

https://api.kameleeon.com/k-api/personalization?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization?siteId=1" \
-d '{
		"name":"perso"
}' \

Parameter

Field Type Description
name String name of Personalization.
HTTP/1.1 200 OK
{
		"result": {
			"cappingPerVisitorConvertGoal": false,
			"goalId": null,
			"popIn": null,
			"description": null,
			"pluginCountDownHeadband": null,
			"globalCappingVisitorsConfiguration": "null",
			"variation": "{name=Variation 1, id=115495}",
			"expositionFrequencySameVisit": null,
			"targetingSegmentId": 45733,
			"trackerData": null,
			"cappingPerVisitorNumberExpositions": false,
			"archived": false,
			"kameleoonTracking": true,
			"pluginGoogleForm": null,
			"customContent": "{customCSS=null, customJavaScript=null}",
			"dateStarted": null,
			"dateEnded": null,
			"goals": [],
			"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
			"expositionFrequencySameVisitorDelaySeconds": null,
			"stickyBlock": null,
			"expositionFrequencySameVisitor": null,
			"id": 17995,
			"expositionFrequencySameVisitorMax": 8,
			"globalCappingNumberVisitors": false,
			"cappingPerVisitorGoalId": null,
			"pluginIAdvize": null,
			"personalizationCheckConditionsRule": "ALL_CONDITIONS",
			"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
			"personalizationStatus": "DRAFT",
			"pluginSocialBar": null,
			"priority": 1,
			"pluginAdBlock": null,
			"personalizationConfiguration": "NONE",
			"variationId": 115495,
			"globalCappingGoalId": null,
			"customExpositionRate": 100,
			"name": "perso",
			"siteId": 14797,
			"imageInPage": null
		},
		"success": true,
		"errors": []
	}

Get Personalization

Get the information of a personalization. Personalization ID and Site IDare required in the URL.

https://api.kameleeon.com/k-api/personalization/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
			"site": {
				"includeJQuery": false,
				"name": "b@b.com",
				"id": 1,
				"googleAnalyticsProfile": null,
				"googleAnalyticsMainGoal": "E_COMMERCE",
				"url": "http://www.gallery-belyaevo.ru"
			},
			"personalizations": {
				"cappingPerVisitorConvertGoal": false,
				"goalId": null,
				"popIn": null,
				"description": null,
				"pluginCountDownHeadband": null,
				"globalCappingVisitorsConfiguration": "null",
				"variation": "{name=Variation 1, id=115495}",
				"expositionFrequencySameVisit": null,
				"targetingSegmentId": 45733,
				"trackerData": null,
				"cappingPerVisitorNumberExpositions": false,
				"archived": false,
				"kameleoonTracking": true,
				"pluginGoogleForm": null,
				"customContent": "{customCSS=null, customJavaScript=null}",
				"dateStarted": null,
				"dateEnded": null,
				"goals": [],
				"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
				"expositionFrequencySameVisitorDelaySeconds": null,
				"stickyBlock": null,
				"expositionFrequencySameVisitor": null,
				"id": 17995,
				"expositionFrequencySameVisitorMax": 8,
				"globalCappingNumberVisitors": false,
				"cappingPerVisitorGoalId": null,
				"pluginIAdvize": null,
				"personalizationCheckConditionsRule": "ALL_CONDITIONS",
				"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
				"personalizationStatus": "DRAFT",
				"pluginSocialBar": null,
				"priority": 1,
				"pluginAdBlock": null,
				"personalizationConfiguration": "NONE",
				"variationId": 115495,
				"globalCappingGoalId": null,
				"customExpositionRate": 100,
				"name": "perso",
				"siteId": 14797,
				"imageInPage": null
			}
		},
		"success": true,
		"errors": []
	}

Get list of Personalizations

Get the list of personalizations of a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/personalization?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
			"site": {
				"includeJQuery": false,
				"name": "b@b.com",
				"id": 1,
				"googleAnalyticsProfile": null,
				"googleAnalyticsMainGoal": "E_COMMERCE",
				"url": "http://www.gallery-belyaevo.ru"
			},
			"personalizations": [
				{
					"cappingPerVisitorConvertGoal": false,
					"goalId": null,
					"popIn": null,
					"description": null,
					"pluginCountDownHeadband": null,
					"globalCappingVisitorsConfiguration": "null",
					"variation": "{name=Variation 1, id=115495}",
					"expositionFrequencySameVisit": null,
					"targetingSegmentId": 45733,
					"trackerData": null,
					"cappingPerVisitorNumberExpositions": false,
					"archived": false,
					"kameleoonTracking": true,
					"pluginGoogleForm": null,
					"customContent": "{customCSS=null, customJavaScript=null}",
					"dateStarted": null,
					"dateEnded": null,
					"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
					"expositionFrequencySameVisitorDelaySeconds": null,
					"stickyBlock": null,
					"expositionFrequencySameVisitor": null,
					"id": 17995,
					"expositionFrequencySameVisitorMax": 8,
					"globalCappingNumberVisitors": false,
					"cappingPerVisitorGoalId": null,
					"pluginIAdvize": null,
					"personalizationCheckConditionsRule": "ALL_CONDITIONS",
					"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
					"personalizationStatus": "DRAFT",
					"pluginSocialBar": null,
					"priority": 1,
					"pluginAdBlock": null,
					"personalizationConfiguration": "NONE",
					"variationId": 115495,
					"globalCappingGoalId": null,
					"customExpositionRate": 100,
					"name": "perso",
					"siteId": 14797,
					"imageInPage": null
				}
			]
		},
		"success": true,
		"errors": []
	}

Update Personalization

Update the information of a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id?siteId=:siteId
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
		"name":"perso new"
}' \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \

Parameter

Field Type Description
name OPTIONAL String name of Personalization.
targetingSegmentId OPTIONAL String Targeting segment id for binding with personalization.
description OPTIONAL String description of Personalization.
personalizationStatus OPTIONAL String status of Personalization. Can be: DRAFT, ACTIVE, PAUSE, ENDED
customExpositionRate OPTIONAL Number percent of Visitors exposed with personalization
priority OPTIONAL Number priority of personalization
resetExpositionFrequencySameVisit OPTIONAL Boolean if true exposition frequency functions will be reseted.
expositionFrequencySameVisit OPTIONAL Number Maximum times of display personalization during a unique visit
expositionFrequencySameVisitor OPTIONAL Number Maximum times of display personalization to the same visitor every n milliseconds
expositionFrequencySameVisitorDelaySeconds OPTIONAL Number Number of milliseconds for repeating exposition behaviour
expositionFrequencyDelaySecondsBetweenTwoExpositions OPTIONAL Number Number of millisecond betveen two expositions of personalization
maxNumberVisitorsExposed OPTIONAL Number
HTTP/1.1 200 OK
{
		"result": {
			"site": {
				"includeJQuery": false,
				"name": "b@b.com",
				"id": 1,
				"googleAnalyticsProfile": null,
				"googleAnalyticsMainGoal": "E_COMMERCE",
				"url": "http://www.gallery-belyaevo.ru"
			},
			"personalizations": {
				"cappingPerVisitorConvertGoal": false,
				"goalId": null,
				"popIn": null,
				"description": null,
				"pluginCountDownHeadband": null,
				"globalCappingVisitorsConfiguration": "null",
				"variation": "{name=Variation 1, id=115495}",
				"expositionFrequencySameVisit": null,
				"targetingSegmentId": 45733,
				"trackerData": null,
				"cappingPerVisitorNumberExpositions": false,
				"archived": false,
				"kameleoonTracking": true,
				"pluginGoogleForm": null,
				"customContent": "{customCSS=null, customJavaScript=null}",
				"dateStarted": null,
				"dateEnded": null,
				"goals": [],
				"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
				"expositionFrequencySameVisitorDelaySeconds": null,
				"stickyBlock": null,
				"expositionFrequencySameVisitor": null,
				"id": 17995,
				"expositionFrequencySameVisitorMax": 8,
				"globalCappingNumberVisitors": false,
				"cappingPerVisitorGoalId": null,
				"pluginIAdvize": null,
				"personalizationCheckConditionsRule": "ALL_CONDITIONS",
				"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
				"personalizationStatus": "DRAFT",
				"pluginSocialBar": null,
				"priority": 1,
				"pluginAdBlock": null,
				"personalizationConfiguration": "NONE",
				"variationId": 115495,
				"globalCappingGoalId": null,
				"customExpositionRate": 100,
				"name": "perso new",
				"siteId": 14797,
				"imageInPage": null
			}
		},
		"success": true,
		"errors": []
	}

Duplicate Personalization

Duplicate a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
			"cappingPerVisitorConvertGoal": false,
			"goalId": null,
			"popIn": null,
			"description": null,
			"pluginCountDownHeadband": null,
			"globalCappingVisitorsConfiguration": "null",
			"variation": "{name=Variation 1, id=115495}",
			"expositionFrequencySameVisit": null,
			"targetingSegmentId": 45733,
			"trackerData": null,
			"cappingPerVisitorNumberExpositions": false,
			"archived": false,
			"kameleoonTracking": true,
			"pluginGoogleForm": null,
			"customContent": "{customCSS=null, customJavaScript=null}",
			"dateStarted": null,
			"dateEnded": null,
			"goals": [],
			"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
			"expositionFrequencySameVisitorDelaySeconds": null,
			"stickyBlock": null,
			"expositionFrequencySameVisitor": null,
			"id": 17995,
			"expositionFrequencySameVisitorMax": 8,
			"globalCappingNumberVisitors": false,
			"cappingPerVisitorGoalId": null,
			"pluginIAdvize": null,
			"personalizationCheckConditionsRule": "ALL_CONDITIONS",
			"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
			"personalizationStatus": "DRAFT",
			"pluginSocialBar": null,
			"priority": 1,
			"pluginAdBlock": null,
			"personalizationConfiguration": "NONE",
			"variationId": 115495,
			"globalCappingGoalId": null,
			"customExpositionRate": 100,
			"name": "perso new-Duplicate",
			"siteId": 14797,
			"imageInPage": null
		},
		"success": true,
		"errors": []
	}

Personalization Results

Get the results of a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id/result?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/personalization/1/result?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"exposedConversionRate": 0.2631060756350064,
	    	"goalId": "9279",
	    	"improvementRate": 0.37823074185193684,
	    	"exposedAverageCart": 4860,
	    	"dates": [
	        	1456520400000,
	        	1456606800000,
	        	1456693200000
	        ],
	        "nonExposedConversionCount": 46486,
	        "trustRate": 100,
	        "exposedRevenues": 7405620,
	        "nonExposedConversionRate": 0.1909013256237988,
	        "exposedCount": 272202,
	        "nonExposedAverageCart": 4847,
	        "goalName": "Transaction",
	        "nonExposedRevenues": 4829727,
	        "nonExposedCount": 243508,
	        "exposedConversionCount": 71618,
	        "goals": [
	            12290
	        ]
	    },
		"success": true,
		"errors": []
	}

Delete Personalization

Delete Personalization. Personalization ID is required in the url.

https://api.kameleeon.com/k-api/personalization/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}

Personalization Schedule

Create schedule for a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id/schedule?siteId=:siteId
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-d '{
     "scheduleItem":{
         "new_1":{
             "scheduleItemOptions":{
                 "":{
                     "daysOfWeekForShow":"EVERYDAY",
                     "hoursStart":"0",
                     "minutesStart":"0",
                     "hoursEnd":"0",
                     "minutesEnd":"0"
                 },
                 "new_2":{
                     "hoursStart":"10",
                     "hoursEnd":"20"
                 }
             },
             "dateStart":1464728400000,
             "dateEnd":null
         }
     }
 }'
"https://api.kameleoon.com/k-api/personalization/1/schedule?siteId=1" \

Parameter

Field Type Description
scheduleItem String Contains list of schedules.
new_i String New schedule item.
dateStart String Time to start personalization in mills.
dateEnd OPTIONAL String Time to end personalization in mills.
scheduleItemOptions OPTIONAL String Time to end schedule in mills.
new_ OPTIONAL String (i+1)] The schedule description.
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}