Volumes
Get file details
GET
/
v1
/
orgs
/
{slug}
/
volumes
/
{id}
/
files
/
stat
Get file details
curl --request GET \
--url https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat \
--header 'Authorization: Bearer <token>' \
--header 'x-msb-file-path: <x-msb-file-path>'import requests
url = "https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat"
headers = {
"x-msb-file-path": "<x-msb-file-path>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-msb-file-path': '<x-msb-file-path>', Authorization: 'Bearer <token>'}
};
fetch('https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat', 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.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat",
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>",
"x-msb-file-path: <x-msb-file-path>"
],
]);
$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.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-msb-file-path", "<x-msb-file-path>")
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.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat")
.header("x-msb-file-path", "<x-msb-file-path>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-msb-file-path"] = '<x-msb-file-path>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"gid": 1,
"kind": "file",
"mode": 1,
"path": "<string>",
"readonly": true,
"size": 1,
"uid": 1,
"accessed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Personal access token (msb_pat_…) or session JWT - the credential an agent acts with on a user's behalf.
Headers
URL-safe base64 encoded volume-relative UTF-8 path
Response
Get file details
Metadata for the requested path.
Metadata for a file or directory within a volume.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Get file details
curl --request GET \
--url https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat \
--header 'Authorization: Bearer <token>' \
--header 'x-msb-file-path: <x-msb-file-path>'import requests
url = "https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat"
headers = {
"x-msb-file-path": "<x-msb-file-path>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-msb-file-path': '<x-msb-file-path>', Authorization: 'Bearer <token>'}
};
fetch('https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat', 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.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat",
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>",
"x-msb-file-path: <x-msb-file-path>"
],
]);
$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.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-msb-file-path", "<x-msb-file-path>")
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.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat")
.header("x-msb-file-path", "<x-msb-file-path>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files/stat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-msb-file-path"] = '<x-msb-file-path>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"gid": 1,
"kind": "file",
"mode": 1,
"path": "<string>",
"readonly": true,
"size": 1,
"uid": 1,
"accessed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
}