Individual vacation management.
SUPPORTED METHODS:
GET
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | Vacation id |
force_user_timezone | enum (0, 1) | 0: do not force users time zone 1: force users time zone |
CREATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
start_date (required) | date | Start date |
end_date (required) | date | End date |
employee (accepted) | integer | Employee id |
comments (accepted) | varchar | Commentes |
start_time (accepted) | time | Start time |
end_time (accepted) | time | End time |
status (accepted) | enum[-2,-1,0,1] | 0: un-approve 1: approve -1: reject -2: cancel |
leavetype (accepted) | varchar | Leave type |
notes (accepted) | varchar | Notes |
is_hourly (accepted) | enum (0, 1) | 0: not hourly leave 1: hourly leave |
force_user_timezone | enum (0, 1) | 0: do not force users time zone 1: force users time zone |
UPDATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | Vacation id |
start_date (accepted) | date | Start date |
end_date (accepted) | date | End date |
start_time (accepted) | time | Start time |
end_time (accepted) | time | End time |
comments (accepted) | varchar | Comments |
notes (accepted) | varchar | Notes |
status (accepted) | enum (0, 1, -1, -2) | 0: un-approve 1: approve -1: reject -2: cancel |
force_user_timezone (accepted) | enum (0,1) | 0: do not force users time zone 1: force users time zone |
reason | varchar | Reason |
DELETE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | Vacation id |
DOCUMENTATION
GET
Retrieves an individual vacation.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"module":"schedule.vacation",
"method":"GET",
"request":{
"id":"265"
}
}
Example response:
{
"status":1,
"data":{
"id":"265",
"store":"11",
"date":"1336655757",
"requested_on":{
"id":"1107",
"month":"5",
"day":"10",
"year":"2017",
"weekday":"Thu",
"mname":"May",
"week":"19",
"dayid":5,
"formatted":"May 10, 2017"
},
"approved_on":"1336656212",
"status":"1",
"admin":"2",
"comments":"",
"notes":"",
"start_day":{
"id":"1109",
"month":"5",
"day":"12",
"year":"2017",
"weekday":"Sat",
"mname":"May",
"week":"19",
"dayid":7,
"formatted":"May 12, 2017"
},
"end_day":{
"id":"1109",
"month":"5",
"day":"12",
"year":"2017",
"weekday":"Sat",
"mname":"May",
"week":"19",
"dayid":7,
"formatted":"May 12, 2017"
},
"employee":"1444",
"employee_name":"Alicia",
"total_days":0
},
"token":"xxxxxxx"
}
CREATE
Creates an individual vacation.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"module":"schedule.vacation",
"method":"CREATE",
"request":{
"start_date":"May 19, 2017",
"end_date":"May 22, 2017",
}
}
Example Response:
{
"status":1,
"data":{
"id":"265",
"store":"11",
"date":"1336655757",
"requested_on":{
"id":"1107",
"month":"5",
"day":"10",
"year":"2017",
"weekday":"Thu",
"mname":"May",
"week":"19",
"dayid":5,
"formatted":"May 5, 2017"
},
"approved_on":"1336656212",
"status":"1",
"admin":"2",
"comments":"",
"notes":"",
"start_day":{
"id":"1109",
"month":"5",
"day":"12",
"year":"2017",
"weekday":"Sat",
"mname":"May",
"week":"19",
"dayid":7,
"formatted":"May 19, 2017"
},
"end_day":{
"id":"1109",
"month":"5",
"day":"12",
"year":"2017",
"weekday":"Sat",
"mname":"May",
"week":"19",
"dayid":7,
"formatted":"May 22, 2017"
},
"employee":"1444",
"employee_name":"Alicia",
"total_days":3
},
"token":"xxxxxxx"
}
UPDATE
Updates an individual vacation.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"module":"schedule.vacation",
"method":"CREATE",
"request":{
"start_date":"May 5, 2017",
"end_date":"May 10, 2017",
"comments":"Vacation",
"status":"approve"
}
}
Example Response:
{
"status":1,
"data":{
"id":"265",
"store":"11",
"date":"1336655757",
"requested_on":{
"id":"1107",
"month":"5",
"day":"10",
"year":"2017",
"weekday":"Thu",
"mname":"May",
"week":"19",
"dayid":5,
"formatted":"May 10, 2017"
},
"approved_on":"1336656212",
"status":"1",
"admin":"2",
"comments":"",
"notes":"",
"start_day":{
"id":"1109",
"month":"5",
"day":"12",
"year":"2017",
"weekday":"Sat",
"mname":"May",
"week":"19",
"dayid":7,
"formatted":"May 12, 2017"
},
"end_day":{
"id":"1109",
"month":"5",
"day":"12",
"year":"2017",
"weekday":"Sat",
"mname":"May",
"week":"19",
"dayid":7,
"formatted":"May 12, 2017"
},
"employee":"1444",
"employee_name":"Alicia",
"total_days":3
},
"token":"xxxxxxx"
}
DELETE
Deletes an individual vacation.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"module":"schedule.vacation",
"method":"DELETE",
"request":{
"id":"258"
}
}
Example Response:
{
"status":1,
"data":"",
"token":"xxxxxxx"
}