POST
Ticket.Messages
Return ticket chat messages mapped for UI, same shape as dashboard customer-tickets ticket_json messages (who, name, role, time, text, type, file, file_url, user_id, image). WhatsApp rows use type=whatsapp and role=WhatsApp. Alias: Ticket.MessagesList, Ticket.Chat, Ticket.ChatList. Raw DB JSON stays on Ticket.Get data.messages; this route returns the UI rows.
Permissions
- User must be logged in with a valid bearer token.
- The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Runs the Ticket.Messages function and returns JSON.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
Special Instructions
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- Use for the CHAT panel listing. Send uses Ticket.Reply (dashboard insert_message Send / Add chat).
- type=only_member is an internal note (Add chat). type=normal is customer-visible (Send). type=whatsapp is Send WhatsApp / inbound WA.
- WhatsApp is detected from msg_type=whatsapp or message markers ~#ticket_id~ / ~wa~ (markers are stripped from mapped text).
- Send provider WhatsApp with Ticket.SendWhatsapp; use Ticket.Reply for email Send / Add chat only.
- who=customer vs who=agent. file_url is absolute when the message is an attachment path.
- Ticket.Get also returns additive data.chat with the same mapped rows; data.messages remains the raw stored JSON.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
ticket_idpost | int | 900 | Ticket id. Aliases: id, data_id, t_id. |
Optional Parameters
No optional body parameters are defined for this function.
Authentication
Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Ticket.Messages",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"ticket_id": "900"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.Messages",
"url_domain": "https:\/\/{domain}\/app\/Ticket.Messages"
}Endpoint
POST /app/Ticket.Messages
POST https://{user}.bull36.com/app/Ticket.Messages
POST https://{domain}/app/Ticket.MessagesSample Output
{
"success": 1,
"ticket_id": 900,
"count": 1,
"data": [
{
"who": "agent",
"name": "User",
"role": "To customer",
"time": "08.09.2026 14:01:00",
"text": "Customer needs help.",
"type": "normal",
"file": "",
"file_url": "",
"user_id": 47,
"image": ""
}
],
"messages": []
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ ticket_id: '900' });
const res = await fetch('/app/Ticket.Messages', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log((await res.json()).data);Error Example
{
"success": 0,
"message": "Ticket not found"
}