Get all widget templates
Get a list of all widget templates. For more information on paramsIO refer to the Get started article, and see the Using paramsIO tutorial for practical use cases. To use optionalFields check out this guide.
curl --request GET \
--url https://api.kameleoon.com/templates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kameleoon.com/templates"
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/templates', 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/templates",
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/templates"
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/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kameleoon.com/templates")
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[
{
"siteId": 123,
"config": "<string>",
"cssCode": "<string>",
"dateActivated": "2023-11-07T05:31:56Z",
"dateCreated": "2023-11-07T05:31:56Z",
"dateModified": "2023-11-07T05:31:56Z",
"description": "<string>",
"htmlCode": "<string>",
"id": 123,
"isCustomTemplate": true,
"name": "<string>",
"status": "DRAFT",
"tags": [
"<string>"
],
"templateCssCode": "<string>",
"templateHtmlCode": "<string>",
"templateJavaScriptCode": "<string>",
"themeId": 123,
"type": "TEMPLATE",
"url": "<string>",
"useCustomData": true,
"widgetEditorTemplate": "<string>",
"surveyDataConfig": {
"fields": [
{
"elementId": "<string>",
"id": "<string>",
"name": "<string>",
"valueType": "BOOLEAN",
"isDeprecated": true,
"parentId": "<string>"
}
],
"isCollectData": true,
"methodTypes": [
"KAMELEOON"
],
"triggerSettings": {
"type": "CLICK",
"value": "<string>"
},
"requestSettings": {
"type": "GET",
"url": "<string>",
"headers": [
{
"id": "<string>",
"name": "<string>",
"type": "CUSTOM_DATA",
"value": "<string>",
"customData": {
"method": "ADOBE_ANALYTICS",
"name": "<string>",
"siteId": 123,
"adobeAnalyticsVariableName": "<string>",
"advancedProposedValues": "<string>",
"createdById": 123,
"customEvalCode": "<string>",
"dateCreated": "2023-11-07T05:31:56Z",
"dateModified": "2023-11-07T05:31:56Z",
"description": "<string>",
"format": "BOOLEAN",
"gtmVariableName": "<string>",
"id": 123,
"index": 123,
"isConstant": true,
"isFiltrableVentilable": true,
"isLearnable": true,
"isLocalOnly": true,
"modificationDate": "2023-11-07T05:31:56Z",
"siteCode": "<string>",
"tags": "<string>",
"tcVariableName": "<string>",
"tealiumVariableName": "<string>",
"type": "COUNT_LIST"
}
}
]
}
}
}
]{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
OK
Web ID of the studio template.
Widget editor configuration field linked to the translation locales field in JSON format.
CSS that belongs to this template.
Date of widget activation.
Date of widget creation
Date of widget modification
Description of the template.
UI text that belongs to this template.
Unique ID of the template
Indicates if this is a custom template.
Name of the template.
Template status.
DRAFT, ACTIVE, PAUSED Tags that belong to this template.
CSS code that belongs to this template.
HTML code that belongs to this template.
JavaScript code that belongs to this template.
ID of the theme linked to the widget.
Type of template.
TEMPLATE, EDITOR, PBX URL associated with this template.
Indicates if custom data is in use.
Widget editor code that belongs to this template.
Configuration settings for survey data collection.
Show child attributes
Show child attributes
Was this page helpful?
curl --request GET \
--url https://api.kameleoon.com/templates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kameleoon.com/templates"
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/templates', 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/templates",
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/templates"
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/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kameleoon.com/templates")
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[
{
"siteId": 123,
"config": "<string>",
"cssCode": "<string>",
"dateActivated": "2023-11-07T05:31:56Z",
"dateCreated": "2023-11-07T05:31:56Z",
"dateModified": "2023-11-07T05:31:56Z",
"description": "<string>",
"htmlCode": "<string>",
"id": 123,
"isCustomTemplate": true,
"name": "<string>",
"status": "DRAFT",
"tags": [
"<string>"
],
"templateCssCode": "<string>",
"templateHtmlCode": "<string>",
"templateJavaScriptCode": "<string>",
"themeId": 123,
"type": "TEMPLATE",
"url": "<string>",
"useCustomData": true,
"widgetEditorTemplate": "<string>",
"surveyDataConfig": {
"fields": [
{
"elementId": "<string>",
"id": "<string>",
"name": "<string>",
"valueType": "BOOLEAN",
"isDeprecated": true,
"parentId": "<string>"
}
],
"isCollectData": true,
"methodTypes": [
"KAMELEOON"
],
"triggerSettings": {
"type": "CLICK",
"value": "<string>"
},
"requestSettings": {
"type": "GET",
"url": "<string>",
"headers": [
{
"id": "<string>",
"name": "<string>",
"type": "CUSTOM_DATA",
"value": "<string>",
"customData": {
"method": "ADOBE_ANALYTICS",
"name": "<string>",
"siteId": 123,
"adobeAnalyticsVariableName": "<string>",
"advancedProposedValues": "<string>",
"createdById": 123,
"customEvalCode": "<string>",
"dateCreated": "2023-11-07T05:31:56Z",
"dateModified": "2023-11-07T05:31:56Z",
"description": "<string>",
"format": "BOOLEAN",
"gtmVariableName": "<string>",
"id": 123,
"index": 123,
"isConstant": true,
"isFiltrableVentilable": true,
"isLearnable": true,
"isLocalOnly": true,
"modificationDate": "2023-11-07T05:31:56Z",
"siteCode": "<string>",
"tags": "<string>",
"tcVariableName": "<string>",
"tealiumVariableName": "<string>",
"type": "COUNT_LIST"
}
}
]
}
}
}
]{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"impersonator": "<string>",
"message": "<string>",
"name": "<string>",
"status": "SUCCESS",
"sub": "<string>",
"time": 123,
"timestamp": "2023-11-07T05:31:56Z"
}