このページはまだ日本語に翻訳されていません。以下は英語の原文です。
Show the desktop in your app
1
Open a desktop session
POST /v1/desktop_sessions with {"machine_id": "mch_...", "read_only": true}. One live session per machine.2
Mint a ticket on your backend
POST /v1/desktop_sessions/{id}/tickets with your page’s origin and a ttl_seconds of 15 to 120. The ticket is single-use and origin-bound, so the browser never holds an API key.3
Connect the browser
Open the returned
ws_url with Sec-WebSocket-Protocol: bma.desktop.v1, bma.ticket.<ticket>. The first frame has to arrive without user action: if the machine is still waking, retry after the Retry-After the API returns.4
Keep it alive, drop viewers
POST /v1/desktop_sessions/{id}/keepalive extends the running capture’s deadline. POST /v1/desktop_sessions/{id}/viewers/{viewer}/revoke closes one viewer’s connections.Take over and hand back
POST …/acquire_control pauses the agent’s desktop actions and gives the person a control lease; renew it with …/renew_control, give it up with …/release_control, or return it to the agent with …/handback_control. Input goes through POST …/actions and is fenced by the control epoch, so a stale client cannot type over a newer one. Several people may watch at once; one holds control.
Terminal
POST /v1/terminal_sessions with {"machine_id": "mch_..."} (optional shell, cwd, cols, rows), then POST /v1/terminal_sessions/{id}/tickets for a single-use connect ticket and attach over WebSocket. Output is resumable: after a disconnect, reattach and the output continues from where it stopped. POST …/close ends the session. GET /v1/terminal_sessions?machine_id=... lists a machine’s sessions.
Terminals are not available on Windows machines.