Get a live view URL
curl --request POST \
--url https://api.zode.dev/v1/sandboxes/{id}/desktop/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"control": false
}
'import requests
url = "https://api.zode.dev/v1/sandboxes/{id}/desktop/session"
payload = { "control": False }
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({control: false})
};
fetch('https://api.zode.dev/v1/sandboxes/{id}/desktop/session', 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.zode.dev/v1/sandboxes/{id}/desktop/session",
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([
'control' => false
]),
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.zode.dev/v1/sandboxes/{id}/desktop/session"
payload := strings.NewReader("{\n \"control\": false\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))
}HttpResponse<String> response = Unirest.post("https://api.zode.dev/v1/sandboxes/{id}/desktop/session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"control\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/sandboxes/{id}/desktop/session")
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 \"control\": false\n}"
response = http.request(request)
puts response.read_body{
"url": "https://eu-1.nodes.zode.dev/desktop/sbx-abc/?t=...",
"transport": "direct",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Browser and desktop
Get a live view URL
A page that shows the desktop (to embed), watch-only or in control.
url is voxl’s web client for this sandbox (H.264 over a WebSocket,
decoded with WebCodecs; needs a secure page). Put it in an iframe with
allow="clipboard-read; clipboard-write; fullscreen; autoplay". Its
ticket opens the page until expires_at (1 hour); the open page
reconnects by itself. Without control the node drops the viewer’s
input; with it, mouse, keyboard, clipboard and files reach the desktop.
direct is served by the sandbox’s host; relay goes through this
API. Audited as sandbox.desktop.connect (detail control).
POST
/
v1
/
sandboxes
/
{id}
/
desktop
/
session
Get a live view URL
curl --request POST \
--url https://api.zode.dev/v1/sandboxes/{id}/desktop/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"control": false
}
'import requests
url = "https://api.zode.dev/v1/sandboxes/{id}/desktop/session"
payload = { "control": False }
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({control: false})
};
fetch('https://api.zode.dev/v1/sandboxes/{id}/desktop/session', 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.zode.dev/v1/sandboxes/{id}/desktop/session",
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([
'control' => false
]),
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.zode.dev/v1/sandboxes/{id}/desktop/session"
payload := strings.NewReader("{\n \"control\": false\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))
}HttpResponse<String> response = Unirest.post("https://api.zode.dev/v1/sandboxes/{id}/desktop/session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"control\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/sandboxes/{id}/desktop/session")
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 \"control\": false\n}"
response = http.request(request)
puts response.read_body{
"url": "https://eu-1.nodes.zode.dev/desktop/sbx-abc/?t=...",
"transport": "direct",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Authorizations
An API key (zode_tok_...). Create one in the console under API keys (https://console.zode.dev/tokens), or with zode login.
⌘I