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.
  • 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

  • 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

NameTypeSampleExplanation
topic
post
stringNeed helpTicket subject. Alias: subject. Dashboard field name=topic, required.
messages
post
stringPlease check my orderFirst message text. Alias: message. Dashboard field name=messages, required.

Optional Parameters

NameTypeSampleWhat it gives
rating
post
int1Urgency 1-5. Default 1.
ticket_department
post
int2ticket_department.id. Alias: department.
product_id
post
array|string["12","15"]Product ids, stored json_encode like dashboard product_id[].
customername
post
stringJaneOptional override of contactus.name.
email
post
string[email protected]Optional override of contactus.email.
phone
post
string0500000000Optional override of contactus.phone.
address
post
stringMain streetOptional override of contactus.address.

Authentication

Send the bearer token returned by Login in the request header.

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.Add

Sample 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"
    ]
}