JavaScript
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
const liveViewUrl = await box.liveView();
console.log(`Live view url: ${liveViewUrl.url}`);
}
main();import os
from gbox_sdk import GboxSDK
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])
box = gbox_sdk.create(type="android")
live_view_url = box.live_view()
print(f"Live view url: {live_view_url.url}")curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/live-view-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiresIn": "180m"
}
'{
"url": "https://gbox.ai/share/live-view/tmp_xxxxxxx",
"rawUrl": "https://gbox.ai/share/live-view/tmp_xxxxxxx/raw"
}Box
Live view url
This endpoint allows you to generate a pre-signed URL for accessing the live view of a running box. The URL is valid for a limited time and can be used to view the box’s live stream.
POST
/
boxes
/
{boxId}
/
live-view-url
JavaScript
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
const liveViewUrl = await box.liveView();
console.log(`Live view url: ${liveViewUrl.url}`);
}
main();import os
from gbox_sdk import GboxSDK
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])
box = gbox_sdk.create(type="android")
live_view_url = box.live_view()
print(f"Live view url: {live_view_url.url}")curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/live-view-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiresIn": "180m"
}
'{
"url": "https://gbox.ai/share/live-view/tmp_xxxxxxx",
"rawUrl": "https://gbox.ai/share/live-view/tmp_xxxxxxx/raw"
}Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Body
application/json
Response
201 - application/json
Generate pre-signed live view url
Live view result
Was this page helpful?