POST

Ticket.TeamScheduleAdd

Create a tickets_teammember_time row for a team member. Same fields as dashboard Setting::add_ticket_appo create mode (day_name[] / from[] / to[] or working_day JSON). Requires manager permission.

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.TeamScheduleAdd function and returns JSON.

Push Service

Pushes event ticket.teamschedule.created to users who should see this change.

Automation

No automation is run for this function.

Special Instructions

  • Requires manager permission.
  • Send working hours as parallel day_name[], from[], to[] (dashboard form) OR as working_day JSON array.
  • from must not be later than to for each day row.
  • One schedule row per team member; duplicate team_member_id returns an error.

Required Parameters

NameTypeSampleExplanation
team_member_id
post
int47Team member id. Alias: member_id.

Optional Parameters

NameTypeSampleWhat it gives
day_name
post
array|stringSundayWorking day name(s), dashboard day_name[]. Alias: day_name[]. Parallel arrays with from[] / to[].
from
post
array|string09:00Start time(s), dashboard from[]. Alias: from[].
to
post
array|string17:00End time(s), dashboard to[]. Alias: to[].
working_day
post
json[{"day_name":"Sunday","from":"09:00","to":"17:00"}]Alternative to day_name[]/from[]/to[]: JSON array of {day_name, from, to}.
work_time
post
jsonOptional legacy work_time JSON if your schema has the column.
color
post
string#1c7ed6Calendar color (default #1c7ed6).

Authentication

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

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Ticket.TeamScheduleAdd",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "team_member_id": "47",
        "color": "#1c7ed6",
        "day_name": [
            "Sunday",
            "Monday"
        ],
        "from": [
            "09:00",
            "09:00"
        ],
        "to": [
            "17:00",
            "17:00"
        ]
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.TeamScheduleAdd",
    "url_domain": "https:\/\/{domain}\/app\/Ticket.TeamScheduleAdd"
}

Endpoint

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

Sample Output

{
    "success": 1,
    "message": "Success",
    "id": 5,
    "socket_event": "ticket.teamschedule.created"
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('team_member_id', '47');
body.set('color', '#1c7ed6');
body.append('day_name[]', 'Sunday');
body.append('from[]', '09:00');
body.append('to[]', '17:00');
const res = await fetch('/app/Ticket.TeamScheduleAdd', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

{
    "success": 0,
    "message": "Missing required parameter: team_member_id"
}