Management of breaks which can be defined for a specific employee assigned to a specific shift.
SUPPORTED METHODS:
GET
Parameters | Type | Description |
---|---|---|
token (required) | string | Valid token |
method | string | value = "GET" |
shift_id (required) | integer | Shift ID of which we want to get breaks. It returns breaks for all employees assigned to a given shift. |
updated_at | date | Updated at |
deleted | enum (0, 1) |
CREATE
Parameters | Type | Description |
---|---|---|
token (required) | string | Valid token |
method | string | value = "CREATE" |
shift_id (required) | integer | ID of a shift |
breaks (required) | Array of Objects | Object contains 3 required fields: employee_id, start, end |
UPDATE
Parameters | Type | Description |
---|---|---|
token (required) | string | Valid token |
method (required) | string | value = "UPDATE" |
shift_id (required) | integer | ID of a shift |
breaks (required) | Array of Objects | Object contains 3 required fields: id, start, end |
DELETE
Parameters | Type | Description |
---|---|---|
token (required) | string | Valid token |
method (required) | string | value = "DELETE" |
shift_id (required) | integer | Break rule id |
breaks (required) | Array of integers | Array of shift break IDs to delete |
DOCUMENTATION
GET
Gets breaks for all employees assigned to a given shift specified by the query parameter shift_id.
Level 5 is required.
--
Example Request:
// Content-Type : application/x-www-form-urlencoded
data:{
"module":"schedule.shiftbreaks",
"method":"GET",
"shift_id":485800755,
"token":"xxxxxxxxxx"
}
Example Response:
{
"status": 1,
"data": [
{
"employee": "2952814",
"breaks": [
{
"id": 138536,
"shift_employee_id": 626646480,
"start": "2018-10-11 04:30:00",
"end": "2018-10-11 04:45:00",
"company_id": 132017,
"created_at": "2018-10-11 12:19:51",
"updated_at": null,
"deleted_at": null,
"created_by": 1417022,
"updated_by": null,
"deleted_by": null
}
]
},
{
"employee": "3213185",
"breaks": [
{
"id": 138537,
"shift_employee_id": 626646481,
"start": "2018-10-11 05:30:00",
"end": "2018-10-11 05:45:00",
"company_id": 132017,
"created_at": "2018-10-11 12:19:51",
"updated_at": null,
"deleted_at": null,
"created_by": 1417022,
"updated_by": null,
"deleted_by": null
}
]
}
],
"metadata": [],
"token": "xxxxxxxxxxx",
"error": null
}
CREATE
Creates a shift break to a shift determined by the parameters shift_id and breaks.
breaks is an array of objects containing 3 fields: employee_id, start and end. employee_id represents an employee assigned to a shift for which we want to add a break.
start and end are break start and break end values with DateTime type.
Level 4 is required.
--
Example request:
// Content-Type : application/x-www-form-urlencoded
data:{
"module":"schedule.shiftbreaks",
"method":"CREATE",
"shift_id":"485800755",
"breaks":[
{
"employee_id":2952814,
"start":"2018-10-11 04:30:00",
"end":"2018-10-11 04:45:00"
},
{
"employee_id":3213185,
"start":"2018-10-11 05:30:00",
"end":"2018-10-11 05:45:00"}
],
"token":"xxxxxxxxxxx"
}
Example Response:
{
"status": 1,
"data": [
{
"employee": "2952814",
"breaks": [
{
"id": 138541,
"shift_employee_id": 626646480,
"start": "2018-10-11 04:30:00",
"end": "2018-10-11 04:45:00",
"company_id": 132017,
"created_at": "2018-10-11 13:15:12",
"updated_at": null,
"deleted_at": null,
"created_by": 1417022,
"updated_by": null,
"deleted_by": null
}
]
},
{
"employee": "3213185",
"breaks": [
{
"id": 138542,
"shift_employee_id": 626646481,
"start": "2018-10-11 05:30:00",
"end": "2018-10-11 05:45:00",
"company_id": 132017,
"created_at": "2018-10-11 13:15:12",
"updated_at": null,
"deleted_at": null,
"created_by": 1417022,
"updated_by": null,
"deleted_by": null
}
]
}
],
"token": "xxxxxxxxxxx"
}
UPDATE
Updates existing shift break by a shift ID and a shift break ID. Only start and end of a break can be changed.
Level 4 is required.
Example request:
// Content-Type : application/x-www-form-urlencoded
data:{
"module":"schedule.shiftbreaks",
"method":"UPDATE",
"shift_id":"485800755",
"breaks":[
{
"id":138541,
"start":"2018-10-11 04:45:00",
"end":"2018-10-11 05:30:00"
},
{
"id":138542,
"start":"2018-10-11 05:10:00",
"end":"2018-10-11 05:30:00"
}
],
"token":"xxxxxxxxxxx"
}
Example Response:
{
"status": 1,
"data": [
{
"employee": "2952814",
"breaks": [
{
"id": 138541,
"shift_employee_id": 626646480,
"start": "2018-10-11 04:45:00",
"end": "2018-10-11 05:30:00",
"company_id": 132017,
"created_at": "2018-10-11 13:15:12",
"updated_at": "2018-10-11 13:28:32",
"deleted_at": null,
"created_by": 1417022,
"updated_by": 1417022,
"deleted_by": null
}
]
},
{
"employee": "3213185",
"breaks": [
{
"id": 138542,
"shift_employee_id": 626646481,
"start": "2018-10-11 05:10:00",
"end": "2018-10-11 05:30:00",
"company_id": 132017,
"created_at": "2018-10-11 13:15:12",
"updated_at": "2018-10-11 13:28:32",
"deleted_at": null,
"created_by": 1417022,
"updated_by": 1417022,
"deleted_by": null
}
]
}
],
"token": "xxxxxxxxxxx"
}
DELETE
Deletes shift breaks from a shift determined by the parameter shift_id, and by shift break IDs array of integers in the parameter breaks.
Level 4 is required.
--
Example Request:
data:{
"module":"schedule.shiftbreaks",
"method":"DELETE",
"shift_id":"485800755",
"breaks":[138536,138537],
"token":"xxxxxxxxxxx"
}
Example Response:
{
"status": 1,
"data": [
{
"employee": "2952814",
"breaks": [
{
"id": 138536,
"shift_employee_id": 626646480,
"start": "2018-10-11 04:30:00",
"end": "2018-10-11 04:45:00",
"company_id": 132017,
"created_at": "2018-10-11 12:19:51",
"updated_at": null,
"deleted_at": "2018-10-11 13:11:38",
"created_by": 1417022,
"updated_by": null,
"deleted_by": 1417022
}
]
},
{
"employee": "3213185",
"breaks": [
{
"id": 138537,
"shift_employee_id": 626646481,
"start": "2018-10-11 05:30:00",
"end": "2018-10-11 05:45:00",
"company_id": 132017,
"created_at": "2018-10-11 12:19:51",
"updated_at": null,
"deleted_at": "2018-10-11 13:11:38",
"created_by": 1417022,
"updated_by": null,
"deleted_by": 1417022
}
]
}
],
"token": "xxxxxxxxxxx"