Update analytics configuration Admin only
curl --request PUT \
--url http://localhost:3000/api/v1/config/analytics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricing": "<string>",
"consumption": "<string>",
"thresholds": "<string>",
"unitConversions": "<string>",
"ratios": "<string>",
"fallbacks": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/config/analytics"
payload = {
"pricing": "<string>",
"consumption": "<string>",
"thresholds": "<string>",
"unitConversions": "<string>",
"ratios": "<string>",
"fallbacks": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pricing: '<string>',
consumption: '<string>',
thresholds: '<string>',
unitConversions: '<string>',
ratios: '<string>',
fallbacks: '<string>'
})
};
fetch('http://localhost:3000/api/v1/config/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/config/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'pricing' => '<string>',
'consumption' => '<string>',
'thresholds' => '<string>',
'unitConversions' => '<string>',
'ratios' => '<string>',
'fallbacks' => '<string>'
]),
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 := "http://localhost:3000/api/v1/config/analytics"
payload := strings.NewReader("{\n \"pricing\": \"<string>\",\n \"consumption\": \"<string>\",\n \"thresholds\": \"<string>\",\n \"unitConversions\": \"<string>\",\n \"ratios\": \"<string>\",\n \"fallbacks\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:3000/api/v1/config/analytics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pricing\": \"<string>\",\n \"consumption\": \"<string>\",\n \"thresholds\": \"<string>\",\n \"unitConversions\": \"<string>\",\n \"ratios\": \"<string>\",\n \"fallbacks\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/config/analytics")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pricing\": \"<string>\",\n \"consumption\": \"<string>\",\n \"thresholds\": \"<string>\",\n \"unitConversions\": \"<string>\",\n \"ratios\": \"<string>\",\n \"fallbacks\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {}
}{
"error": "<string>",
"details": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Configuration
Update analytics configuration Admin only
Update analytics configuration Admin only
Required capabilities: update_analytics_config.
Auth middleware: verifyToken.
PUT
/
api
/
v1
/
config
/
analytics
Update analytics configuration Admin only
curl --request PUT \
--url http://localhost:3000/api/v1/config/analytics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pricing": "<string>",
"consumption": "<string>",
"thresholds": "<string>",
"unitConversions": "<string>",
"ratios": "<string>",
"fallbacks": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/config/analytics"
payload = {
"pricing": "<string>",
"consumption": "<string>",
"thresholds": "<string>",
"unitConversions": "<string>",
"ratios": "<string>",
"fallbacks": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pricing: '<string>',
consumption: '<string>',
thresholds: '<string>',
unitConversions: '<string>',
ratios: '<string>',
fallbacks: '<string>'
})
};
fetch('http://localhost:3000/api/v1/config/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/config/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'pricing' => '<string>',
'consumption' => '<string>',
'thresholds' => '<string>',
'unitConversions' => '<string>',
'ratios' => '<string>',
'fallbacks' => '<string>'
]),
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 := "http://localhost:3000/api/v1/config/analytics"
payload := strings.NewReader("{\n \"pricing\": \"<string>\",\n \"consumption\": \"<string>\",\n \"thresholds\": \"<string>\",\n \"unitConversions\": \"<string>\",\n \"ratios\": \"<string>\",\n \"fallbacks\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("http://localhost:3000/api/v1/config/analytics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pricing\": \"<string>\",\n \"consumption\": \"<string>\",\n \"thresholds\": \"<string>\",\n \"unitConversions\": \"<string>\",\n \"ratios\": \"<string>\",\n \"fallbacks\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/config/analytics")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pricing\": \"<string>\",\n \"consumption\": \"<string>\",\n \"thresholds\": \"<string>\",\n \"unitConversions\": \"<string>\",\n \"ratios\": \"<string>\",\n \"fallbacks\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {}
}{
"error": "<string>",
"details": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
JWT obtained from POST /api/v1/auth/login.
Body
application/json
pricing — see API source for exact type.
consumption — see API source for exact type.
thresholds — see API source for exact type.
unitConversions — see API source for exact type.
ratios — see API source for exact type.
fallbacks — see API source for exact type.
Was this page helpful?
⌘I