Objective: Uploads one or more base64-encoded attachments to an existing Zoho Desk ticket. Identifies the ticket via zoho_id, ticket_number or chamado_id. Limit of 10MB per file. Accepted types: PDF, images (JPG/PNG/GIF), Office documents, TXT, ZIP and RAR.
Method: PUT or POST
URL: https://oms.tpl.com.br/api/put/ticket_attachments
Authentication
Base64 token generated by /api/get/auth endpoint ("auth" field)
Request JSON
{
"auth": "BASE64_TOKEN",
"zoho_id": "123456789012345678",
"ticket_number": "12345",
"chamado_id": "99",
"attachments": [
{
"nome_arquivo": "document.pdf",
"tipo_arquivo": "application/pdf",
"arquivo_base64": "JVBERi0xLjQK..."
},
{
"name": "photo.jpg",
"contentType": "image/jpeg",
"base64": "/9j/4AAQSkZJRg..."
}
]
}
Note: Provide at least one identifier: zoho_id, ticket_number or chamado_id.
Note: The "attachments" field also accepts the alias "anexos".
Note: For name/type/base64, aliases are accepted: nome_arquivo/name, tipo_arquivo/contentType, arquivo_base64/base64.
Required fields: auth, attachments (array with at least 1 item)
Limit per file: 10MB
Accepted types: application/pdf, image/jpeg, image/jpg, image/png, image/gif, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain, application/zip, application/x-rar-compressed, application/vnd.rar
Response JSON (Success - HTTP 200)
{
"success": true,
"zoho_id": "123456789012345678",
"uploaded": 2,
"failed": 0,
"results": [
{
"index": 0,
"name": "document.pdf",
"contentType": "application/pdf",
"success": true,
"http_code": 201,
"error": null
},
{
"index": 1,
"name": "photo.jpg",
"contentType": "image/jpeg",
"success": true,
"http_code": 201,
"error": null
}
]
}
Response JSON (Error)
HTTP 400:
{ "success": false, "error": "attachments is required (array)" }
{ "success": false, "error": "Could not identify zoho_id (provide valid zoho_id or ticket_number/chamado_id)" }
HTTP 401:
{ "success": false, "error": "auth is required" }
{ "success": false, "error": "invalid auth" }
{ "success": false, "error": "Invalid credentials" }
HTTP 403:
{ "success": false, "error": "Client blocked" }
HTTP 405:
{ "success": false, "error": "Method not allowed" }
HTTP 500:
{ "success": false, "error": "Internal error: ..." }