Control

Take a screenshot (headers only)

The GET of this path with no response body. It is authorized exactly as the GET is and answers its statuses and headers, never a body: an error’s correlation is in X-Request-ID alone. Range is ignored. It runs the GET’s own read and discards the body, so it touches whatever that read touches, the guest included: it is not a lighter way to poll.

Requires the viewer role or higher.

head/computers/{id}/screenshot

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/computers/{id}/screenshot
  • Auth: HTTP bearer

Path parameters

idstring required

The computer id.

Query parameters

fresh'1' | 'true' | '0' | 'false'

Skip the cache and capture now: 1 or true. 0 or false is the same as leaving it out. Pass this whenever the screenshot is feeding a decision.

capturestring

Answer from the capture an earlier screenshot named in X-GC-Capture, rather than from the screen now, so a crop can be worked out on one answer and cut from the same pixels by the next. A capture that is no longer held answers 409 with reason: stale_capture. Not with fresh, which asks for a capture taken after the request.

winteger

Downscale to this width and answer JPEG instead of PNG unless format says otherwise. For thumbnails. A positive whole number: 0, a negative number or anything else is a 400. A width below 64 is raised to 64, and one wider than what is being shrunk — the screen, or the region — is lowered to its width, so the picture is never enlarged. Not with scale. On a suspended computer it is accepted and ignored: the saved frame (up to 640 pixels wide) comes back unchanged.

scalenumber

Downscale by this factor, greater than 0 and at most 1, keeping the encoding PNG unless format says otherwise. 0.5 halves both sides, which is a quarter of the pixels a model is sent. Not with w.

regionstring

Crop to x,y,width,height, in the capture’s own pixels — the size X-GC-Capture-Size reports, which is ordinarily resolution — before any scaling. The region has to lie inside the capture: one that reaches past an edge answers 400 naming its size, rather than being clipped to a smaller picture than you asked for. With capture, it is cut from that capture.

format'png' | 'jpeg' | 'jpg'

The encoding. PNG by default, JPEG by default with w.

qualityinteger

JPEG quality, 1 to 100; 72 when not given. With a PNG answer it is a 400.

Response

The current screen, or the region of it asked for, as PNG — or JPEG with w or format=jpeg. A live answer carries X-GC-Capture (the capture it was cut from, to send back as capture) and X-GC-Capture-Size (that capture’s width x height in pixels). Suspended sessions return a saved JPEG marked X-GC-Frame: suspended, with neither.

Changes

No recorded changes to this operation across all 1 revision of this API.