PUT
Attach a photo to a ticket

Authorizations

Authorization
string
header
required

Obtain a token via POST /api/v1/oauth/token (password grant) and send it as Authorization: Bearer <token>.

Headers

If-Match
string

The ticket's current _rev for optimistic concurrency. Omit for last-write-wins.

Path Parameters

database
string
required

Project identifier (each project has its own database). Obtain it from GET /api/v2/data/projects.

ticketId
string
required

Body

multipart/form-data
photo
file
required

The image bytes. Required, and must not be empty. A JPEG or a PNG — judged by decoding the bytes, so the file name and the part's declared content type are both ignored.

Response

The stored file names, plus the comment the photo was attached to.

The result of PUT /tickets/{database}/{ticketId}/uploadAttachment. fileName is authoritative — the stored name is derived from the bytes and from what is already on the ticket, not from the name you sent.

fileName
string

The name the photo is stored under: a single-dot, URL-safe name with the extension the bytes require. Read it from here rather than assuming the name you uploaded.

Example:

"crack.jpg"

thumbnailFileName
string

The generated .256x192 thumbnail, stored alongside. Always fileName with .256x192 inserted before the extension.

Example:

"crack.256x192.jpg"

contentType
enum<string>

The content type detected from the bytes. Two values, not the three the 422 message lists: detection names a JPEG image/jpeg, so image/jpg cannot be the answer here however a file was named or declared.

Available options:
image/jpeg,
image/png
Example:

"image/jpeg"

length
integer

Size of the stored original in bytes.

Example:

12345

comment
object

The comment the photo was attached to — note empty, attachments holding fileName. This is what makes the photo appear in the app's ticket timeline and on the drawing pin's popover.