Objective: Returns complete ticket details including local data (database), Zoho Desk threads/conversations and attachments. Identifies the ticket via ticket_number, zoho_id or chamado_id. Optionally fetches updated data from Zoho with refresh=1.
Method: GET
URL: https://oms.tpl.com.br/api/get/ticket_details
Authentication
Base64 token generated by /api/get/auth endpoint ("auth" field)
Request JSON (via body)
{
"auth": "BASE64_TOKEN",
"ticket_number": "12345",
"zoho_id": "123456789012345678",
"chamado_id": "99",
"refresh": 1
}
Note: Provide at least one identifier: ticket_number, zoho_id or chamado_id.
Note: This endpoint does NOT accept URL parameters (only JSON body).
Note: The "refresh" field (optional, default 0) when =1 fetches updated data directly from Zoho Desk.
Required fields: auth + (ticket_number or zoho_id or chamado_id)
Response JSON (Success - HTTP 200)
{
"success": true,
"ticket": {
"id": 99,
"ticket_number": "12345",
"zoho_id": "123456789012345678",
"webUrl": "https://desk.zoho.com/...",
"status": "Open",
"created_at": "2026-05-10 14:30:00",
"updated_at": "2026-05-12 09:15:00",
"subject": "Ticket subject",
"description": "Detailed description",
"department": "TECNOLOGIA",
"category": "Support",
"numero_pedido": "12345",
"numero_nf": "67890",
"cliente": {
"id": 100,
"apelido": "COMPANY LTDA",
"cnpj": "12345678000100"
},
"usuario": {
"nome": "User Name",
"email": "user@company.com"
}
},
"zoho": {
"id": "123456789012345678",
"ticketNumber": "12345",
"subject": "Ticket subject",
"description": "Detailed description",
"status": "Open",
"priority": "Medium",
"category": "Support",
"departmentName": "TECNOLOGIA",
"createdTime": "2026-05-10T17:30:00.000Z",
"modifiedTime": "2026-05-12T12:15:00.000Z",
"webUrl": "https://desk.zoho.com/...",
"cf": {
"cf_numero_do_pedido": "12345",
"cf_numero_da_nota_fiscal": "67890"
}
},
"threads": [
{
"id": "111222333",
"data": "2026-05-10 14:30:00",
"canal": "EMAIL",
"direcao": "in",
"autor": "User Name",
"autor_email": "user@company.com",
"summary": "Message summary...",
"conteudo": "Full message content...",
"hasAttach": false,
"attachmentCount": 0,
"visibility": "public"
},
{
"id": "444555666",
"data": "2026-05-11 10:00:00",
"canal": "EMAIL",
"direcao": "out",
"autor": "Agent",
"autor_email": "support@company.com",
"summary": "Support reply...",
"conteudo": "Reply content...",
"hasAttach": true,
"attachmentCount": 1,
"visibility": "public"
}
],
"attachments": [
{
"id": "777888999",
"name": "file.pdf",
"contentType": "application/pdf",
"size": 102400,
"sizeFormatted": "100 KB",
"href": "https://desk.zoho.com/api/v1/...",
"createdTime": "2026-05-11 10:00:00",
"threadId": "444555666"
}
]
}
Note: The "zoho" field is only returned when refresh=1 and the ticket has a zoho_id.
Note: "threads" and "attachments" are automatically fetched from Zoho when the ticket has a zoho_id.
Note: Thread dates are converted to São Paulo timezone (America/Sao_Paulo).
Response JSON (Error)
HTTP 400:
{ "success": false, "error": "Provide ticket_number, zoho_id or chamado_id" }
{ "success": false, "error": "This endpoint only accepts JSON body (no URL parameters)" }
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 404:
{ "success": false, "error": "Ticket not found" }
HTTP 405:
{ "success": false, "error": "Method not allowed" }
HTTP 500:
{ "success": false, "error": "Internal error: ..." }