Update a variable
curl --request PATCH \
--url https://api.kadoa.com/v4/variables/{variableId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "<string>",
"value": "<string>",
"dataType": "STRING"
}
'import requests
url = "https://api.kadoa.com/v4/variables/{variableId}"
payload = {
"key": "<string>",
"value": "<string>",
"dataType": "STRING"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', value: '<string>', dataType: 'STRING'})
};
fetch('https://api.kadoa.com/v4/variables/{variableId}', 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.kadoa.com/v4/variables/{variableId}",
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([
'key' => '<string>',
'value' => '<string>',
'dataType' => 'STRING'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.kadoa.com/v4/variables/{variableId}"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.kadoa.com/v4/variables/{variableId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kadoa.com/v4/variables/{variableId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}"
response = http.request(request)
puts response.read_body{
"variable": {
"id": "<string>",
"key": "<string>",
"value": "<string>",
"createdAt": "<string>",
"dataType": "STRING",
"updatedAt": "<string>"
},
"error": "<string>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}Variables
Update a variable
Update an existing variable. At least one field (key, value, or dataType) must be provided.
PATCH
/
v4
/
variables
/
{variableId}
Update a variable
curl --request PATCH \
--url https://api.kadoa.com/v4/variables/{variableId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "<string>",
"value": "<string>",
"dataType": "STRING"
}
'import requests
url = "https://api.kadoa.com/v4/variables/{variableId}"
payload = {
"key": "<string>",
"value": "<string>",
"dataType": "STRING"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({key: '<string>', value: '<string>', dataType: 'STRING'})
};
fetch('https://api.kadoa.com/v4/variables/{variableId}', 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.kadoa.com/v4/variables/{variableId}",
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([
'key' => '<string>',
'value' => '<string>',
'dataType' => 'STRING'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.kadoa.com/v4/variables/{variableId}"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.kadoa.com/v4/variables/{variableId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kadoa.com/v4/variables/{variableId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"dataType\": \"STRING\"\n}"
response = http.request(request)
puts response.read_body{
"variable": {
"id": "<string>",
"key": "<string>",
"value": "<string>",
"createdAt": "<string>",
"dataType": "STRING",
"updatedAt": "<string>"
},
"error": "<string>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}Authorizations
API key for authentication
Path Parameters
Variable ID
Body
application/json
Body
⌘I