POST
/
boxes
/
{boxId}
/
actions
/
recording
/
stop
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" });

  console.log("Starting recording...");
  await box.action.recording.start();
 
  console.log("Tapping on chrome app...");
  await box.action.tap({ target: "chrome app" });

  console.info(`sleeping for 5 seconds...`);
  await new Promise((resolve) => setTimeout(resolve, 5000));

  console.log("Stopping recording...");
  const result = await box.action.recording.stop();

  console.log(`Download URL: ${result.presignedUrl}`);
}

main();
{
  "storageKey": "storage://gbox/recording/1234567890",
  "presignedUrl": "https://gbox.ai/api/v1/boxes/1234567890/recording/1234567890"
}

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

Response

200 - application/json

Recording stop result

storageKey
string
required

Storage key of the recording. Before the box is deleted, you can use this storageKey with the endpoint box/:boxId/storage/presigned-url to get a downloadable URL for the recording.

Example:

"storage://gbox/recording/1234567890"

presignedUrl
string
required

Presigned URL of the recording. This is a temporary downloadable URL with an expiration time for accessing the recording file.

Example:

"https://gbox.ai/api/v1/boxes/1234567890/recording/1234567890"