POST
WorkingTime.StartStop
Start or stop the active customer working timer in The route checks customer access, prevents duplicate active timers, runs start_customer_working_hours or stop_customer_working_hours automation, and emits the matching realtime event.
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
- Updates the requested WorkingTime record after validating permissions and input fields.
Push Service
Pushes event start_customer_working_hours to users who should see this change.
Automation
Runs automation event start_customer_working_hours with the record id and submitted parameters after the action succeeds.
Special Instructions
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- Send parameters as POST body fields exactly as documented.
- Send date/time values in UTC Y-m-d H:i:s format when a date or datetime field is used.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
customer_idpost | int | 123 | Customer id for the timer. You may also send id. |
timer_actionpost | string | start | Use start to begin a timer or stop to close the active timer. |
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
notepost | string | Phone call | Adds or updates the timer note. |
categorypost | string | support | Classifies the timer by work category. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/WorkingTime.StartStop",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"customer_id": "123",
"timer_action": "start",
"note": "Phone call"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/WorkingTime.StartStop",
"url_domain": "https:\/\/{domain}\/app\/WorkingTime.StartStop"
}Endpoint
POST /app/WorkingTime.StartStop
POST https://{user}.bull36.com/app/WorkingTime.StartStop
POST https://{domain}/app/WorkingTime.StartStopSample Output
{
"success": 1,
"message": "Time counter updated.",
"type": "start",
"id": "55",
"automation_event": "start_customer_working_hours",
"socket_event": "start_customer_working_hours"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({});
// Fill body fields from the Sample Request JSON above.
const res = await fetch('/app/WorkingTime.StartStop', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": 0,
"message": "Customer was not found."
}