Create a ticket covers raising a ticket and changing its fields. This recipe covers the two things you add to an existing one: a comment, and a photo. Both appear in the ticket timeline in the Ed Controls apps, attributed to your service account. Neither is a PATCH field. comments is not on the PATCH whitelist, so a comment sent through PATCH returns 200 and stores nothing — these are the endpoints that actually write.

Add a comment

201, with the stored comment:
You supply the text and nothing else. author comes from the token, time from the server clock, and the timeline entry that makes the comment visible in the app is written for you.
The request field is body; the stored field is note. They are not the same word, and the body is a closed schema — body is the only key accepted:
author, time, public, attachments and allowedUsers are refused the same way, even though all five appear on the comment you get back. Sending them is rejected rather than ignored, so a comment never silently loses the author or timestamp you thought you set.
body must be a non-blank string. null, a number, "" and whitespace-only text are each 422 — a blank comment renders as an empty timeline entry, which is indistinguishable from nothing having been stored.

Attach a photo

multipart/form-data, one part named photo:
201:
The stored file name is not necessarily the one you sent — read fileName back from the response.The name is sanitised to a single-dot, URL-safe form and given the extension the bytes require:fileName is the only name the file can be fetched under. Storing the name you uploaded and building URLs from it produces 404s that look like the upload failed.

The photo is attached as a comment

The upload writes a comment whose attachments holds the stored file name, and that is how the photo reaches the apps: it shows in the ticket’s timeline, and on the drawing pin’s popover. The note is empty, which is what the apps write for an attachment-only comment too. A .256x192 thumbnail is generated and stored alongside the original — thumbnailFileName names it. The apps request that name directly, so you get both files or neither: a photo whose thumbnail cannot be produced is refused rather than stored half-way.

What is accepted

image/jpeg and image/png, judged by decoding the bytes. The part’s declared Content-Type and the file name are both ignored, so a PNG renamed .jpg is accepted and stored as a PNG, and a PDF renamed .jpg is refused:
An image of another format names itself in the detail — the 'photo' part is image/gif; … — so you can tell “wrong format” from “not an image at all”. The detail lists a third type, image/jpg. Nothing is ever detected as one — a JPEG is detected as image/jpeg — so the response contentType is only ever image/jpeg or image/png. The message quotes the server’s allowed-types list, which it shares with the project endpoint, rather than the set of outcomes.

Read the files back

Both the original and the thumbnail are readable from securedata, using the stored names:
Reading the ticket also lists the file names on the comment:

End to end

Raise a ticket, attach the evidence, then say what you found:

Concurrency

Both endpoints take an optional If-Match carrying the ticket’s current _rev:
A stale _rev fails with 409 and writes nothing. Omit the header and the latest revision is read. Both writes are additive — a comment is appended, a photo is added beside whatever is already attached — so unlike PATCH there is nothing here that can overwrite someone else’s change. If-Match is worth using when you want to be sure the ticket you read is the ticket you are commenting on, and can safely be left off otherwise.
There is no idempotency key on either endpoint. A retried request adds a second comment, or a second copy of the photo under a suffixed name (crack-1.jpg). Neither can be deleted through the API — removing a comment or an attachment is an in-app action — so retry only when you know the first attempt did not land.

Errors

RFC 9457 application/problem+json, whose detail names the problem: Authorization is evaluated before the request body, so a 403 says nothing about whether your JSON or your image was valid.
415 is the one error that is not application/problem+json. A non-multipart upload is refused by the framework before it reaches the endpoint, so it carries the default error shape instead:
Error handling that reads detail has to tolerate that one response. Every other status above has it.

Who may do what

Commenting is deliberately the wider of the two. A comment cannot overwrite anything, and someone who raised a ticket needs to be able to answer a question about it once work has started. An attachment is a permanent binary on the document that this API cannot remove, so it inherits the narrower rule that PATCH puts around editing content. See Roles & permissions.

What you still cannot do

  • Give a ticket a map snapshot. The crosshair image at content.attachments[0] is a different thing in a different place — see Ticket snapshots. This endpoint attaches photos only.
  • Attach anything but a JPEG or a PNG. No PDFs, no video, no documents.
  • Delete a comment or an attachment. Both are in-app actions.
  • Attach at creation time. Create the ticket first, then upload — two calls.