Skip to main content
PATCH
/
widget-studio-templates
/
{studioTemplateId}
Partially update studio template
curl --request PATCH \
  --url https://api.kameleoon.com/widget-studio-templates/{studioTemplateId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": 123,
  "isFavorite": true,
  "siteId": 123,
  "studioTemplate": "<string>",
  "widgetId": 123
}
'
import requests

url = "https://api.kameleoon.com/widget-studio-templates/{studioTemplateId}"

payload = {
"id": 123,
"isFavorite": True,
"siteId": 123,
"studioTemplate": "<string>",
"widgetId": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 123,
isFavorite: true,
siteId: 123,
studioTemplate: '<string>',
widgetId: 123
})
};

fetch('https://api.kameleoon.com/widget-studio-templates/{studioTemplateId}', 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/widget-studio-templates/{studioTemplateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => 123,
'isFavorite' => true,
'siteId' => 123,
'studioTemplate' => '<string>',
'widgetId' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.kameleoon.com/widget-studio-templates/{studioTemplateId}"

payload := strings.NewReader("{\n \"id\": 123,\n \"isFavorite\": true,\n \"siteId\": 123,\n \"studioTemplate\": \"<string>\",\n \"widgetId\": 123\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.kameleoon.com/widget-studio-templates/{studioTemplateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 123,\n \"isFavorite\": true,\n \"siteId\": 123,\n \"studioTemplate\": \"<string>\",\n \"widgetId\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.kameleoon.com/widget-studio-templates/{studioTemplateId}")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 123,\n \"isFavorite\": true,\n \"siteId\": 123,\n \"studioTemplate\": \"<string>\",\n \"widgetId\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "siteId": 123,
  "id": 123,
  "isFavorite": true,
  "studioTemplate": "<string>",
  "widgetId": 123
}
{
"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.

Path Parameters

studioTemplateId
integer<int64>
required

Id of the widget studio template object

Body

application/json
id
integer<int64>

Id of the widget studio template

isFavorite
boolean

Indicates if the template has been marked as a favorite

siteId
integer<int64>

Site Id of the project this widget studio template belongs to

studioTemplate
string

Data that belongs to this widget studio template

widgetId
integer<int64>

Widget that can be parsed and used as a studio template

Response

OK

siteId
integer<int64>
required

Site Id of the widget studio template.

id
integer<int64>
read-only

Unique Id of the given widget studio template.

isFavorite
boolean

Indicates if this template has been marked as a favorite.

studioTemplate
string

Widget studio template data that is associated with this template.

widgetId
integer<int64>

Widget that can be parsed and used as a studio template.