cURL
curl --request PUT \
--url http://localhost:8001/api/devices/{id} \
--header 'Content-Type: application/json; charset=utf-8' \
--data '
{
"device_name": "<string>",
"firmware_version": "<string>",
"default_workspace_id": "<string>",
"led_color": "<string>",
"opus_on_send": true,
"opus_on_save": true,
"device_kind": "<string>",
"device_mode": "<string>",
"parent_hub_device_id": "<string>",
"privacy_until": "<string>"
}
'import requests
url = "http://localhost:8001/api/devices/{id}"
payload = {
"device_name": "<string>",
"firmware_version": "<string>",
"default_workspace_id": "<string>",
"led_color": "<string>",
"opus_on_send": True,
"opus_on_save": True,
"device_kind": "<string>",
"device_mode": "<string>",
"parent_hub_device_id": "<string>",
"privacy_until": "<string>"
}
headers = {"Content-Type": "application/json; charset=utf-8"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json; charset=utf-8'},
body: JSON.stringify({
device_name: '<string>',
firmware_version: '<string>',
default_workspace_id: '<string>',
led_color: '<string>',
opus_on_send: true,
opus_on_save: true,
device_kind: '<string>',
device_mode: '<string>',
parent_hub_device_id: '<string>',
privacy_until: '<string>'
})
};
fetch('http://localhost:8001/api/devices/{id}', 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 => "8001",
CURLOPT_URL => "http://localhost:8001/api/devices/{id}",
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([
'device_name' => '<string>',
'firmware_version' => '<string>',
'default_workspace_id' => '<string>',
'led_color' => '<string>',
'opus_on_send' => true,
'opus_on_save' => true,
'device_kind' => '<string>',
'device_mode' => '<string>',
'parent_hub_device_id' => '<string>',
'privacy_until' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json; charset=utf-8"
],
]);
$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:8001/api/devices/{id}"
payload := strings.NewReader("{\n \"device_name\": \"<string>\",\n \"firmware_version\": \"<string>\",\n \"default_workspace_id\": \"<string>\",\n \"led_color\": \"<string>\",\n \"opus_on_send\": true,\n \"opus_on_save\": true,\n \"device_kind\": \"<string>\",\n \"device_mode\": \"<string>\",\n \"parent_hub_device_id\": \"<string>\",\n \"privacy_until\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json; charset=utf-8")
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:8001/api/devices/{id}")
.header("Content-Type", "application/json; charset=utf-8")
.body("{\n \"device_name\": \"<string>\",\n \"firmware_version\": \"<string>\",\n \"default_workspace_id\": \"<string>\",\n \"led_color\": \"<string>\",\n \"opus_on_send\": true,\n \"opus_on_save\": true,\n \"device_kind\": \"<string>\",\n \"device_mode\": \"<string>\",\n \"parent_hub_device_id\": \"<string>\",\n \"privacy_until\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8001/api/devices/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json; charset=utf-8'
request.body = "{\n \"device_name\": \"<string>\",\n \"firmware_version\": \"<string>\",\n \"default_workspace_id\": \"<string>\",\n \"led_color\": \"<string>\",\n \"opus_on_send\": true,\n \"opus_on_save\": true,\n \"device_kind\": \"<string>\",\n \"device_mode\": \"<string>\",\n \"parent_hub_device_id\": \"<string>\",\n \"privacy_until\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}Device
Put devices
PUT
/
devices
/
{id}
cURL
curl --request PUT \
--url http://localhost:8001/api/devices/{id} \
--header 'Content-Type: application/json; charset=utf-8' \
--data '
{
"device_name": "<string>",
"firmware_version": "<string>",
"default_workspace_id": "<string>",
"led_color": "<string>",
"opus_on_send": true,
"opus_on_save": true,
"device_kind": "<string>",
"device_mode": "<string>",
"parent_hub_device_id": "<string>",
"privacy_until": "<string>"
}
'import requests
url = "http://localhost:8001/api/devices/{id}"
payload = {
"device_name": "<string>",
"firmware_version": "<string>",
"default_workspace_id": "<string>",
"led_color": "<string>",
"opus_on_send": True,
"opus_on_save": True,
"device_kind": "<string>",
"device_mode": "<string>",
"parent_hub_device_id": "<string>",
"privacy_until": "<string>"
}
headers = {"Content-Type": "application/json; charset=utf-8"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json; charset=utf-8'},
body: JSON.stringify({
device_name: '<string>',
firmware_version: '<string>',
default_workspace_id: '<string>',
led_color: '<string>',
opus_on_send: true,
opus_on_save: true,
device_kind: '<string>',
device_mode: '<string>',
parent_hub_device_id: '<string>',
privacy_until: '<string>'
})
};
fetch('http://localhost:8001/api/devices/{id}', 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 => "8001",
CURLOPT_URL => "http://localhost:8001/api/devices/{id}",
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([
'device_name' => '<string>',
'firmware_version' => '<string>',
'default_workspace_id' => '<string>',
'led_color' => '<string>',
'opus_on_send' => true,
'opus_on_save' => true,
'device_kind' => '<string>',
'device_mode' => '<string>',
'parent_hub_device_id' => '<string>',
'privacy_until' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json; charset=utf-8"
],
]);
$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:8001/api/devices/{id}"
payload := strings.NewReader("{\n \"device_name\": \"<string>\",\n \"firmware_version\": \"<string>\",\n \"default_workspace_id\": \"<string>\",\n \"led_color\": \"<string>\",\n \"opus_on_send\": true,\n \"opus_on_save\": true,\n \"device_kind\": \"<string>\",\n \"device_mode\": \"<string>\",\n \"parent_hub_device_id\": \"<string>\",\n \"privacy_until\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json; charset=utf-8")
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:8001/api/devices/{id}")
.header("Content-Type", "application/json; charset=utf-8")
.body("{\n \"device_name\": \"<string>\",\n \"firmware_version\": \"<string>\",\n \"default_workspace_id\": \"<string>\",\n \"led_color\": \"<string>\",\n \"opus_on_send\": true,\n \"opus_on_save\": true,\n \"device_kind\": \"<string>\",\n \"device_mode\": \"<string>\",\n \"parent_hub_device_id\": \"<string>\",\n \"privacy_until\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8001/api/devices/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json; charset=utf-8'
request.body = "{\n \"device_name\": \"<string>\",\n \"firmware_version\": \"<string>\",\n \"default_workspace_id\": \"<string>\",\n \"led_color\": \"<string>\",\n \"opus_on_send\": true,\n \"opus_on_save\": true,\n \"device_kind\": \"<string>\",\n \"device_mode\": \"<string>\",\n \"parent_hub_device_id\": \"<string>\",\n \"privacy_until\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}{
"success": true,
"message": "<string>"
}Body
application/json; charset=utf-8