Java (SDK)
package hello.world;
import java.lang.Exception;
import java.util.Map;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.*;
import org.openapis.openapi.models.operations.CreateUserSettingResponse;
public class Application {
public static void main(String[] args) throws BadRequestException, UnauthorizedException, InternalServerError, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateUserSettingResponse res = sdk.userSettings().create()
.category("trading")
.body(Map.ofEntries(
Map.entry("theme", "dark"),
Map.entry("auto_trading", true),
Map.entry("risk_level", "medium"),
Map.entry("max_position_size", 10000L),
Map.entry("custom_config", Map.ofEntries(
Map.entry("nested", "value")))))
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request POST \
--url https://api.tradearies.dev/v1/config/{category}/user-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"theme": "dark",
"auto_trading": true,
"risk_level": "medium",
"max_position_size": 10000,
"custom_config": {
"nested": "value"
}
}
'import requests
url = "https://api.tradearies.dev/v1/config/{category}/user-settings"
payload = {
"theme": "dark",
"auto_trading": True,
"risk_level": "medium",
"max_position_size": 10000,
"custom_config": { "nested": "value" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
theme: 'dark',
auto_trading: true,
risk_level: 'medium',
max_position_size: 10000,
custom_config: {nested: 'value'}
})
};
fetch('https://api.tradearies.dev/v1/config/{category}/user-settings', 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/{category}/user-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'theme' => 'dark',
'auto_trading' => true,
'risk_level' => 'medium',
'max_position_size' => 10000,
'custom_config' => [
'nested' => 'value'
]
]),
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.tradearies.dev/v1/config/{category}/user-settings"
payload := strings.NewReader("{\n \"theme\": \"dark\",\n \"auto_trading\": true,\n \"risk_level\": \"medium\",\n \"max_position_size\": 10000,\n \"custom_config\": {\n \"nested\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/config/{category}/user-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"theme\": \"dark\",\n \"auto_trading\": true,\n \"risk_level\": \"medium\",\n \"max_position_size\": 10000,\n \"custom_config\": {\n \"nested\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "User settings created successfully"
}{
"error": "User setting already exists",
"codes": [
{
"code": "USER_SETTING_ALREADY_EXISTS",
"description": "User setting already exists"
}
]
}{
"error": "Unauthorized"
}{
"error": "Internal server error"
}User Settings
Create User Setting
Create new user settings for a category.
Requires bearer token authentication
POST
/
v1
/
config
/
{category}
/
user-settings
Java (SDK)
package hello.world;
import java.lang.Exception;
import java.util.Map;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.errors.*;
import org.openapis.openapi.models.operations.CreateUserSettingResponse;
public class Application {
public static void main(String[] args) throws BadRequestException, UnauthorizedException, InternalServerError, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateUserSettingResponse res = sdk.userSettings().create()
.category("trading")
.body(Map.ofEntries(
Map.entry("theme", "dark"),
Map.entry("auto_trading", true),
Map.entry("risk_level", "medium"),
Map.entry("max_position_size", 10000L),
Map.entry("custom_config", Map.ofEntries(
Map.entry("nested", "value")))))
.call();
if (res.object().isPresent()) {
// handle response
}
}
}curl --request POST \
--url https://api.tradearies.dev/v1/config/{category}/user-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"theme": "dark",
"auto_trading": true,
"risk_level": "medium",
"max_position_size": 10000,
"custom_config": {
"nested": "value"
}
}
'import requests
url = "https://api.tradearies.dev/v1/config/{category}/user-settings"
payload = {
"theme": "dark",
"auto_trading": True,
"risk_level": "medium",
"max_position_size": 10000,
"custom_config": { "nested": "value" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
theme: 'dark',
auto_trading: true,
risk_level: 'medium',
max_position_size: 10000,
custom_config: {nested: 'value'}
})
};
fetch('https://api.tradearies.dev/v1/config/{category}/user-settings', 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/{category}/user-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'theme' => 'dark',
'auto_trading' => true,
'risk_level' => 'medium',
'max_position_size' => 10000,
'custom_config' => [
'nested' => 'value'
]
]),
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.tradearies.dev/v1/config/{category}/user-settings"
payload := strings.NewReader("{\n \"theme\": \"dark\",\n \"auto_trading\": true,\n \"risk_level\": \"medium\",\n \"max_position_size\": 10000,\n \"custom_config\": {\n \"nested\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/config/{category}/user-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"theme\": \"dark\",\n \"auto_trading\": true,\n \"risk_level\": \"medium\",\n \"max_position_size\": 10000,\n \"custom_config\": {\n \"nested\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "User settings created successfully"
}{
"error": "User setting already exists",
"codes": [
{
"code": "USER_SETTING_ALREADY_EXISTS",
"description": "User setting already exists"
}
]
}{
"error": "Unauthorized"
}{
"error": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Category of the setting (e.g., 'display', 'trading', 'notifications')
Body
application/json
User settings data as key-value pairs
The body is of type object.
Response
User settings created successfully
Was this page helpful?
⌘I