GET
/
boxes
/
{boxId}
/
actions
/
screen-layout
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" });

  // Get screen layout
  const layout = await box.action.screenLayout();

  console.log(layout);
}

main();
{
  "content": "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\n<hierarchy rotation=\"0\">\n  <node index=\"0\" text=\"\" resource-id=\"\" class=\"android.widget.FrameLayout\" package=\"com.android.systemui\" content-desc=\"\" checkable=\"false\" checked=\"false\" clickable=\"false\" enabled=\"true\" focusable=\"false\" focused=\"false\" scrollable=\"false\" long-clickable=\"false\" password=\"false\" selected=\"false\" bounds=\"[0,0][1080,2316]\" displayed=\"true\">\n    <!-- UI elements -->\n  </node>\n</hierarchy>"
}

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

Structured screen layout information (XML format for Android boxes)

Screen layout content.

Android boxes (XML):

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<hierarchy rotation="0">
<node ... />
</hierarchy>

Browser (Linux) boxes (HTML):

<html>
<head><title>Example</title></head>
<body>
<h1>Hello World</h1>
</body>
</html>