Request employee availability approval
SUPPORTED METHODS:
GET
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
type (required) | enum (future, weekly) | future: Future availability weekly: Weekly availability |
user (accepted) | integer | User id |
UPDATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
user (required) | integer | User id |
type (required) | enum (future, weekly) | future: Future availability weekly: Weekly availability |
action (required) | enum (approve, reject) | approve: Approve availability reject: Reject availability |
start_time (accepted) | time | Start time |
end_time (accepted) | time | End time |
day (accepted) | enum (1, 2, 3, 4, 5, 6, 7) | 1: Sunday 2: Monday 3: Tuesday 4: Wednesday 5: Thursday 6: Friday 7: Saturday |
start_date (accepted) | date | Start date |
id (accepted) | integer |
CREATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
comment (accepted) | varchar | Comment |
user (accepted) | integer | User id |
DOCUMENTATION
GET
Request employee availability approval.
Level 3 is required.
--
Example Request:
{
"method":"GET",
"module":"availability.approve",
"request":{
"type":"future"
}
}
Example Response:
{
"status": 1,
"data": [
{
"id": "4271810",
"user": "2165774",
"day_timestamp": {
"id": 3112,
"month": 11,
"day": 5,
"wday": 0,
"year": 2017,
"weekday": "Sun",
"mname": "Nov",
"week": 44,
"dayid": 1,
"timeid": 1,
"timeid_exact": 1,
"formatted": "Nov 5, 2017",
"iso8601": "2017-11-05T00:00:00+0100",
"time": "12:00am",
"timestamp": 1509836400,
"hours": 0,
"minutes": 0,
"seconds": 0,
"date": "2017-11-05 00:00:00",
"day_of_year": "308",
"week_adjusted": 44,
"sp_wday": 1
},
"date": "1488459034",
"name": "Brus Vejn",
"day": 3112
},
{
"id": "4271813",
"user": "2165774",
"day_timestamp": {
"id": 3113,
"month": 11,
"day": 6,
"wday": 1,
"year": 2017,
"weekday": "Mon",
"mname": "Nov",
"week": 45,
"dayid": 2,
"timeid": 1,
"timeid_exact": 1,
"formatted": "Nov 6, 2017",
"iso8601": "2017-11-06T00:00:00+0100",
"time": "12:00am",
"timestamp": 1509922800,
"hours": 0,
"minutes": 0,
"seconds": 0,
"date": "2017-11-06 00:00:00",
"day_of_year": "309",
"week_adjusted": 45,
"sp_wday": 2
},
"date": "1488459076",
"name": "Brus Vejn",
"day": 3113
},
{
"id": "4271818",
"user": "2165774",
"day_timestamp": {
"id": 3114,
"month": 11,
"day": 7,
"wday": 2,
"year": 2017,
"weekday": "Tue",
"mname": "Nov",
"week": 45,
"dayid": 3,
"timeid": 1,
"timeid_exact": 1,
"formatted": "Nov 7, 2017",
"iso8601": "2017-11-07T00:00:00+0100",
"time": "12:00am",
"timestamp": 1510009200,
"hours": 0,
"minutes": 0,
"seconds": 0,
"date": "2017-11-07 00:00:00",
"day_of_year": "310",
"week_adjusted": 45,
"sp_wday": 3
},
"date": "1488459189",
"name": "Brus Vejn",
"day": 3114
},
{
"id": "4670828",
"user": "2097936",
"day_timestamp": {
"id": 2984,
"month": 6,
"day": 30,
"wday": 5,
"year": 2017,
"weekday": "Fri",
"mname": "Jun",
"week": 26,
"dayid": 6,
"timeid": 1,
"timeid_exact": 1,
"formatted": "Jun 30, 2017",
"iso8601": "2017-06-30T00:00:00+0200",
"time": "12:00am",
"timestamp": 1498773600,
"hours": 0,
"minutes": 0,
"seconds": 0,
"date": "2017-06-30 00:00:00",
"day_of_year": "180",
"week_adjusted": 26,
"sp_wday": 6
},
"date": "1497270877",
"name": "Jelena Pavlovic",
"day": 2984
},
{
"id": "4670836",
"user": "2097936",
"day_timestamp": {
"id": 3011,
"month": 7,
"day": 27,
"wday": 4,
"year": 2017,
"weekday": "Thu",
"mname": "Jul",
"week": 30,
"dayid": 5,
"timeid": 29,
"timeid_exact": 29,
"formatted": "Jul 27, 2017",
"iso8601": "2017-07-27T07:00:00+0200",
"time": "7:00am",
"timestamp": 1501131600,
"hours": 7,
"minutes": 0,
"seconds": 0,
"date": "2017-07-27 07:00:00",
"day_of_year": "207",
"week_adjusted": 30,
"sp_wday": 5
},
"date": "1497270986",
"name": "Jelena Pavlovic",
"day": 3011
}
],
"token": "xxxxxxx"
}
CREATE
Create future availability that needs approval.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"method":"CREATE",
"module":"availability.approve",
"request":{
"user":52,
"start_date":"27-07-2017"
}
}
Example Response:
{
"status":1,
"data":"Approval Request Sent",
"token":"xxxxxxx"
}
UPDATE
Update future availability.
Level 3 is required.
--
Example Request:
{
"method":"UPDATE",
"module":"availability.approve",
"request":{
"user":52,
"type":"future",
"action":"approve"
}
}
Example Response:
{
"status":1,
"data":"Availability Approved",
"token":"xxxxxxx"
}