POST

Ticket.Counts

Return all, open, and closed ticket counts in one call (dashboard counts_json pills). Uses the same filters as Ticket.List; status filters are ignored so open/closed are derived from status=2 vs not.

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 Ticket.Counts 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

  • status / status_id / status_filter_val are stripped so All / Open / Closed stay consistent with the dashboard pills.
  • Pass the same optional filters you use on Ticket.List (search, team, department, customer, phone, address, dates).

Required Parameters

No body parameters are required for this function.

Optional Parameters

NameTypeSampleWhat it gives
type
post
stringmy_ticketsTicket bucket: my_tickets (default, Biz1 Support) or company_tickets (Customers Tickets).
searchh
post
stringpaymentSearch ticket id, subject, customer name, email, phone, mobile. Aliases: search, filter_data, search[value].
team_member
post
array|string47,48Assigned team member filter. Aliases: team_member_id, assign_member_id.
department
post
array|string2Department ids to include.
customer_id
post
int123Only tickets for this customer. Alias: cust_id.
phone
post
string0500000000Search phone and mobile fields.
address
post
stringMain streetSearch address text.
from_date
post
date2026-07-01Open date range start, inclusive. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part.
to_date
post
date2026-07-31Open date range end, inclusive. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part.
start_date_of_Due
post
date2026-07-01Due date range start, inclusive. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part.
end_date_of_Due
post
date2026-07-31Due date range end, inclusive. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part.

Authentication

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

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Ticket.Counts",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "type": "my_tickets",
        "searchh": "payment",
        "phone": "0500000000",
        "from_date": "2026-07-01",
        "to_date": "2026-07-31"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.Counts",
    "url_domain": "https:\/\/{domain}\/app\/Ticket.Counts"
}

Endpoint

POST /app/Ticket.Counts
POST https://{user}.bull36.com/app/Ticket.Counts
POST https://{domain}/app/Ticket.Counts

Sample Output

{
    "success": 1,
    "all": 42,
    "open": 30,
    "closed": 12
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({ type: 'my_tickets', searchh: 'payment', phone: '0500000000' });
const res = await fetch('/app/Ticket.Counts', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

{
    "success": "0",
    "error": "bearer_token_required",
    "message": "Authorization bearer token is required. Send header: Authorization: Bearer YOUR TOKEN"
}