POST
Customer.Tickets.Add
Create a client-portal ticket, same fields as dashboard/client/tickets #formtiket → Clientproject::new_ticket. Saves type=my_tickets, cust_id from token, u_id=org, status=1, open_date as MySQL DATETIME Y-m-d H:i:s (same as staff Ticket.Add). First message JSON time stays d.m.Y H:i:s, direction=0, user_id=c_id. Required: topic + messages. rating default 1. product_id stored as JSON array of strings. department from ticket_department.
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 Customer.Tickets.Add 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.
- Does not change staff Ticket.Add.
- Name/email/phone/address default from the logged-in contactus row (hidden fields on the dashboard form).
- File/image upload is not included on this JSON route; send text in messages.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
topicpost | string | Need help | Ticket subject. Alias: subject. Dashboard field name=topic, required. |
messagespost | string | Please check my order | First message text. Alias: message. Dashboard field name=messages, required. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
ratingpost | int | 1 | Urgency 1-5. Default 1. |
ticket_departmentpost | int | 2 | ticket_department.id. Alias: department. |
product_idpost | array|string | ["12","15"] | Product ids, stored json_encode like dashboard product_id[]. |
customernamepost | string | Jane | Optional override of contactus.name. |
emailpost | string | jane@example.com | Optional override of contactus.email. |
phonepost | string | 0500000000 | Optional override of contactus.phone. |
addresspost | string | Main street | Optional override of contactus.address. |
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\/Customer.Tickets.Add",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"topic": "Need help",
"messages": "Please check my order",
"rating": "1"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Customer.Tickets.Add",
"url_domain": "https:\/\/{domain}\/app\/Customer.Tickets.Add"
}Endpoint
POST /app/Customer.Tickets.Add
POST https://{user}.bull36.com/app/Customer.Tickets.Add
POST https://{domain}/app/Customer.Tickets.AddSample Output
{
"success": 1,
"output": "1",
"insert_id": 901,
"ticket_id": 901
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('topic', 'Need help');
body.set('messages', 'Please check my order');
body.set('rating', '1');
const res = await fetch('/app/Customer.Tickets.Add', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data);Error Example
{
"success": "0",
"error": "missing_required_parameter",
"missing": [
"topic"
]
}