curl --request GET \
--url https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output', 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.ravion.com/sandboxes/{id}/commands/{commandId}/output",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"seq": 123,
"type": "stdout",
"data": "<string>",
"exitCode": 123,
"signal": "<string>"
}Stream a sandbox command's output (SSE)
Stream a command’s output as server-sent events. GET /sandboxes//commands//output in the Ravion API reference.
curl --request GET \
--url https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output', 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.ravion.com/sandboxes/{id}/commands/{commandId}/output",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/sandboxes/{id}/commands/{commandId}/output")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"seq": 123,
"type": "stdout",
"data": "<string>",
"exitCode": 123,
"signal": "<string>"
}Query Parameters
Resume after this seq: events up to and including it are not replayed. Omitted, the stream starts from the first event the sandbox still holds. The Last-Event-ID header does the same on an SSE reconnect.
x >= 0Response
SSE stream of a command's output events.
One event of a command's output stream. Every event is delivered as the SSE data: JSON
with type telling it apart, and carries seq as the SSE id: so a dropped connection
resumes where it left off.
Position of the event in the command's output. Starts at 1 and increases by one per event; pass it back as afterSeq or Last-Event-ID to resume.
Which part of the output this event is.
stdout, stderr, exit, truncated The output chunk, base64 encoded. Set for stdout and stderr events.
Exit code, on the exit event when the command exited on its own.
Signal that ended the command, on the exit event when one did.
Was this page helpful?