curl --request GET \
--url https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}', 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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}",
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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}"
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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}")
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<string>{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}Stream file modification events in a directory
Streams change events for a directory until the client disconnects.
The body is JSON lines (sent with Content-Type: text/plain): one event object per line, e.g. {"op":"WRITE","name":"main.go","path":"/app/src","error":null}. op is the fsnotify operation (CREATE, WRITE, REMOVE, RENAME or CHMOD, several can be joined with |), name the base name of the changed entry, path the directory containing it, and error is always null. A [keepalive] line (not JSON) is sent every 30 seconds. The response starts once the watch is registered, and the stream ends when the watched directory is removed or renamed, or when events were dropped because the kernel queue overflowed (reopen and resync).
Only the directory’s direct entries are watched. To also watch every subdirectory, including ones created later, end the path with /**. The stream reports subsequent changes without an initial snapshot. When a new directory is detected, synthetic CREATE events are emitted for entries already present inside it to cover changes before its watch was registered.
curl --request GET \
--url https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}', 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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}",
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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}"
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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/watch/filesystem/{path}")
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<string>{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Directory path to watch (append /** to watch subdirectories)
Query Parameters
Comma-separated substrings; events whose full path contains one are skipped, and matching directories are not watched at all
Response
JSON lines stream of change events
The response is of type string.
Was this page helpful?