Java (SDK)
package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.ToggleFeatureFlagResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
ToggleFeatureFlagResponse res = sdk.settings().toggleFeatureFlag()
.key("new_ui_enabled")
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request PATCH \
--url https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}import requests
url = "https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}', 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.tradearies.dev/v1/config/toggle-feature-flag/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$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.tradearies.dev/v1/config/toggle-feature-flag/{key}"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_body{}{
"error": "Failed to toggle feature flag",
"codes": [
{
"code": "FAILED_TO_TOGGLE_FEATURE_FLAG",
"description": "Failed to toggle feature flag"
}
]
}Settings
Toggle Feature Flag
Toggle a feature flag on/off.
Does not require authentication
PATCH
/
v1
/
config
/
toggle-feature-flag
/
{key}
Java (SDK)
package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.ToggleFeatureFlagResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
ToggleFeatureFlagResponse res = sdk.settings().toggleFeatureFlag()
.key("new_ui_enabled")
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request PATCH \
--url https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}import requests
url = "https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}', 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.tradearies.dev/v1/config/toggle-feature-flag/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$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.tradearies.dev/v1/config/toggle-feature-flag/{key}"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/config/toggle-feature-flag/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_body{}{
"error": "Failed to toggle feature flag",
"codes": [
{
"code": "FAILED_TO_TOGGLE_FEATURE_FLAG",
"description": "Failed to toggle feature flag"
}
]
}Path Parameters
The feature flag key to toggle
Response
Feature flag toggled successfully
The response is of type object.
Was this page helpful?
⌘I