updateBotAllocations
curl --request POST \
--url https://alphainsider.com/api/updateBotAllocations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"bot_id": "<string>",
"allocations": [
{
"strategy_id": "<string>",
"percent": 0.5
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({bot_id: '<string>', allocations: [{strategy_id: '<string>', percent: 0.5}]})
};
fetch('https://alphainsider.com/api/updateBotAllocations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alphainsider.com/api/updateBotAllocations"
payload = {
"bot_id": "<string>",
"allocations": [
{
"strategy_id": "<string>",
"percent": 0.5
}
]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://alphainsider.com/api/updateBotAllocations",
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([
'bot_id' => '<string>',
'allocations' => [
[
'strategy_id' => '<string>',
'percent' => 0.5
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://alphainsider.com/api/updateBotAllocations"
payload := strings.NewReader("{\n \"bot_id\": \"<string>\",\n \"allocations\": [\n {\n \"strategy_id\": \"<string>\",\n \"percent\": 0.5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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))
}{
"success": true,
"response": [
{
"bot_allocation_id": "g1DDEzc68EPrWyhSxRPHJ",
"bot_id": "h_zZfeqsX9o8hgB8DVc0P",
"strategy_id": "YbKCgktxu0ugmQ1QKCfA3",
"percent": "0.6",
"strategy_value": "1",
"positions": [
{
"position_id": "G3nEoY0dAYGXpucdAMC5R",
"strategy_id": "YbKCgktxu0ugmQ1QKCfA3",
"type": "asset",
"price": "1.000000000000000",
"amount": "1.000000000000000",
"total": "1.000000000000000",
"updated_at": "2024-10-17T14:24:25.987Z",
"created_at": "2024-10-17T14:24:25.987Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
}
],
"updated_at": "2024-10-23T14:45:48.648Z",
"created_at": "2024-10-23T14:45:48.648Z"
},
{
"bot_allocation_id": "1Su_xi4PbyC2o4HhOmjxO",
"bot_id": "h_zZfeqsX9o8hgB8DVc0P",
"strategy_id": "WuRnay0CF3P1oPRSdogj5",
"percent": "0.4",
"strategy_value": "1",
"positions": [
{
"position_id": "RSTqnGGFOBVONbKNzrLUq",
"strategy_id": "WuRnay0CF3P1oPRSdogj5",
"type": "asset",
"price": "1.000000000000000",
"amount": "1.000000000000000",
"total": "1.000000000000000",
"updated_at": "2024-10-22T20:44:42.391Z",
"created_at": "2024-10-22T20:44:42.391Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
}
],
"updated_at": "2024-10-23T14:45:48.648Z",
"created_at": "2024-10-23T14:45:48.648Z"
}
]
}{
"success": false,
"response": "Request failed."
}{
"success": false,
"response": "Authentication failed."
}Bots
updateBotAllocations
Update bot allocations.
POST
/
updateBotAllocations
updateBotAllocations
curl --request POST \
--url https://alphainsider.com/api/updateBotAllocations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"bot_id": "<string>",
"allocations": [
{
"strategy_id": "<string>",
"percent": 0.5
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({bot_id: '<string>', allocations: [{strategy_id: '<string>', percent: 0.5}]})
};
fetch('https://alphainsider.com/api/updateBotAllocations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alphainsider.com/api/updateBotAllocations"
payload = {
"bot_id": "<string>",
"allocations": [
{
"strategy_id": "<string>",
"percent": 0.5
}
]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://alphainsider.com/api/updateBotAllocations",
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([
'bot_id' => '<string>',
'allocations' => [
[
'strategy_id' => '<string>',
'percent' => 0.5
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://alphainsider.com/api/updateBotAllocations"
payload := strings.NewReader("{\n \"bot_id\": \"<string>\",\n \"allocations\": [\n {\n \"strategy_id\": \"<string>\",\n \"percent\": 0.5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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))
}{
"success": true,
"response": [
{
"bot_allocation_id": "g1DDEzc68EPrWyhSxRPHJ",
"bot_id": "h_zZfeqsX9o8hgB8DVc0P",
"strategy_id": "YbKCgktxu0ugmQ1QKCfA3",
"percent": "0.6",
"strategy_value": "1",
"positions": [
{
"position_id": "G3nEoY0dAYGXpucdAMC5R",
"strategy_id": "YbKCgktxu0ugmQ1QKCfA3",
"type": "asset",
"price": "1.000000000000000",
"amount": "1.000000000000000",
"total": "1.000000000000000",
"updated_at": "2024-10-17T14:24:25.987Z",
"created_at": "2024-10-17T14:24:25.987Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
}
],
"updated_at": "2024-10-23T14:45:48.648Z",
"created_at": "2024-10-23T14:45:48.648Z"
},
{
"bot_allocation_id": "1Su_xi4PbyC2o4HhOmjxO",
"bot_id": "h_zZfeqsX9o8hgB8DVc0P",
"strategy_id": "WuRnay0CF3P1oPRSdogj5",
"percent": "0.4",
"strategy_value": "1",
"positions": [
{
"position_id": "RSTqnGGFOBVONbKNzrLUq",
"strategy_id": "WuRnay0CF3P1oPRSdogj5",
"type": "asset",
"price": "1.000000000000000",
"amount": "1.000000000000000",
"total": "1.000000000000000",
"updated_at": "2024-10-22T20:44:42.391Z",
"created_at": "2024-10-22T20:44:42.391Z",
"stock_id": "ubfhvYUsgvMIuJPwr76My",
"figi_composite": null,
"symbol": "USD",
"name": "US Dollar",
"sector": "Unallocated",
"security": "",
"exchange": "ALPHAINSIDER",
"stock": "USD",
"peg": "USD",
"provider": "alphainsider",
"slippage": "0.000000000000000",
"fee": "0.000000000000000",
"links": {},
"stock_status": "active",
"bid": "1.00",
"ask": "1.00",
"last": "1.00"
}
],
"updated_at": "2024-10-23T14:45:48.648Z",
"created_at": "2024-10-23T14:45:48.648Z"
}
]
}{
"success": false,
"response": "Request failed."
}{
"success": false,
"response": "Authentication failed."
}Headers
User API token.
Body
application/json
⌘I