Upload Ticket Attachment
This endpoint allows you to upload an attachment to a ticket.
Request
POST /api/v1/tickets/:ticket/attachments
curl --request POST \
--url 'https://www.zep-online.de/zepinstanz/next/api/v1/tickets/123/attachments' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"filename": "document.pdf",
"file_contents": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PgplbmRvYmoKMiAwIG9iago8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1szIDAgUl0+PgplbmRvYmoKMyAwIG9iago8PC9UeXBlL1BhZ2UvTWVkaWFCb3hbMCAwIDYxMiA3OTJdL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PD4+Pj4KZW5kb2JqCnhyZWYKMCA0CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxNSAwMDAwMCBuIAowMDAwMDAwMDYyIDAwMDAwIG4gCjAwMDAwMDAxMTUgMDAwMDAgbiAKdHJhaWxlcgo8PC9TaXplIDQvUm9vdCAxIDAgUj4+CnN0YXJ0eHJlZgoxOTYKJSVFT0Y="
}'Parameters
- ticket (integer, required): The ticket ID
Required Fields
- filename (string): The name of the file being uploaded
- file_contents (string): Base64-encoded file contents
Response
Successful Upload
{
"success": true
}A successful upload returns an object with success: true.
Error Codes
- 401 Unauthorized: Invalid or missing authentication
- 404 Not Found: Ticket with the specified ID was not found
- 500 Internal Server Error: Upload failed
Notes
- The file must be encoded as a Base64 string
- Ensure the file size is within allowed limits
- Supported file formats may vary depending on system configuration
- The filename should include the correct file extension
Example
To upload a file, you must first encode the file contents to Base64:
# Example for Base64 encoding on the command line
base64 document.pdfThen use the encoded string in the request:
POST /api/v1/tickets/123/attachmentsRequest Body:
{
"filename": "document.pdf",
"file_contents": "JVBERi0xLjQKJeLjz9MK..."
}Response:
{
"success": true
}