Docs
Desktop ›

Scroll desktop

POST/v1/sandboxes/{id}/desktop/scroll

Moves the pointer to a point of the sandbox's screen and turns the wheel there: dy notches down, or up when it is negative, and dx notches to the right, or to the left.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. await sandbox.desktop.scroll(640, 360, { dy: 3 });
Answer204 No Content

No body: the status says it was done.

Done.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Body

xrequired
integer
Pixels from the left edge of the screen. e.g. 640
yrequired
integer
Pixels from the top edge of the screen. e.g. 400
dx
integer
Notches of the wheel to the right, or to the left when it is negative. 0 when it is not given. e.g. 3
dy
integer
Notches of the wheel down, or up when it is negative. 0 when it is not given. e.g. 3

Returns

204 Done. There is nothing to say back: GET /v1/sandboxes/{id}/desktop/screenshot shows what came of it.

Errors and other answers

400invalid_request a field is missing or is not what it has to be, or a point is not on the screen. The message says which.
404 Not found.
409 sandbox_not_running, or
409desktop_not_running no desktop is turned on for the sandbox, or it is turned on and is not running yet, as in the moments after a start. PUT /v1/sandboxes/{id}/desktop turns it on, and starts one that ended.
501desktop_not_configured sandboxes here have no desktop. GET /v1/policy says so as desktop.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.