Desktop ›
Get desktop clipboard
GET
/v1/sandboxes/{id}/desktop/clipboardThe text on the clipboard of the sandbox's desktop: what a paste there, as ctrl+v, would put in. It is empty when the clipboard holds no text. It changes nothing.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- const text = await sandbox.desktop.clipboard();
Answer200 OK · DesktopClipboard
- {
- "text": string,
- }
The text on the clipboard.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 The text on the clipboard.
DesktopClipboard1 field
textstring
Errors and other answers
| 404 | Not found. |
| 409 | sandbox_not_running, or |
| 409 | desktop_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. |
| 501 | desktop_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.