How a snapshot is stored
The apps write two attachments per capture, named after the capture time (YYYYMMDD-HHMMSS):
The full-size name is inserted at index 0 of
content.attachments, ahead of
any photos, which is how the apps recognise it.
Reading a snapshot
Fetch the ticket through the list endpoint, filtered on its id. That gives you both the ordered name list and resolvable URLs:GET /tickets/{database}/{ticketId} returns the stored document instead,
which has the file names but no resolved URLs.
Take content.attachments[0], find the matching entry in attachments[] by
fileName, and download its name URL. A ticket with an empty
content.attachments has no snapshot.
The URLs in
attachments[] are short-lived. Fetch them as part of the same
run; do not cache them.Rendering a snapshot yourself
The tiles a drawing is rendered into are served per zoom level and tile index:z— zoom level,0(whole page in one tile) to6(full detail)row— tile index down,col— tile index across, both from0ext—webporpng; read it from the map’sattachments[0].content_typerather than guessing
z the page is renderinfo.width / 2^(6-z) by
renderinfo.height / 2^(6-z) pixels, so a ticket’s zoom-0 coordinates scale up
as x * 2^z, y * 2^z. That is the whole trick: scale the coordinates to the
capture zoom, work out which tiles cover the window you want around them, and
composite.
The crosshair the apps draw, for a pixel-identical result: 5 px stroke in
#ff0000 — a filled dot at the centre, a circle of radius 40, and four line
segments running from 20 px to 50 px out along each axis.
404 — a pin near an edge legitimately produces
a window with white margins, exactly as the app renders it. A 404 on every
tile means the drawing has not finished tiling yet, or the extension is wrong.
Getting a snapshot onto a ticket
There is no endpoint for it, so the options are:- Let the app do it. A pin moved in the web or mobile app regenerates the snapshot, so tickets created by an integration pick one up as soon as somebody touches them.
- Keep it on your side. Render the image yourself and store it in your own
system, keyed on the ticket
_id. This is enough for external dashboards and reports and needs nothing from Ed Controls beyond the tiles.
Uploading your rendered image with
PUT …/uploadAttachment is not a
substitute. It attaches the file as a comment attachment, so the image shows
in the ticket timeline and on the pin’s popover — but it does not become the
ticket’s snapshot. The ticket list and PDF reports read
content.attachments[0], and that slot stays empty.