Returns Future Availability for a given day time period
SUPPORTED METHODS:
GET
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
user (accepted) | integer | User id |
approved (accepted) | enum (0, 1) | 0: Unapproved 1: Approved |
start_date (accepted) | date | Start date |
end_date (accepted) | date | End date |
CREATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
start_date (required) | date | Start date |
user (accepted) | integer | User id |
UPDATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | |
flag (required) | enum (1, 2, 3) | 1: Unavailable, 2: Available, 3: Wants to work |
times (required) | enum (Array) | [\“Nov 21, 2017 00:00\“,\“Nov 21, 2017 01:00\“] |
time_type (accepted) | time_type |
DELETE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
user (accepted) | integer | User id |
start_date (required) | date | Start date |
DOCUMENTATION
GET
Returns Future Availability for a given day time period.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"method":"GET",
"module":"availability.future",
"request":{
"user":2097936
}
}
Example Response:
{
"status": 1,
"data": {
"4670828": {
"date": {
"id": 2983,
"month": 6,
"day": 29,
"wday": 4,
"year": 2017,
"weekday": "Thu",
"mname": "Jun",
"week": 26,
"dayid": 5,
"timeid": 69,
"timeid_exact": 69,
"formatted": "Jun 29, 2017",
"iso8601": "2017-06-29T17:00:00-0500",
"time": "5:00pm",
"timestamp": 1498773600,
"hours": 17,
"minutes": 0,
"seconds": 0,
"date": "2017-06-29 17:00:00",
"day_of_year": "179",
"week_adjusted": 26,
"sp_wday": 5
},
"availability": [],
"approved": "0",
"approved_by": "0",
"times": "-"
}
},
"token": "xxxxxxx"
}
CREATE
Create Future Availability for a given date.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"method":"CREATE",
"module":"availability.future",
"request":{
"user":2097936,
"start_date":"27-07-2017"
}
}
Example Response:
{
"status": 1,
"data": 4670836,
"token": "xxxxxxx"
}
UPDATE
Update Future Availability for a given date and time.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"method":"UPDATE",
"module":"availability.future",
"request":{
"user":2097936,
"flag":1,
"times":“[\“Nov 21, 2017 00:00\“,\“Nov 21, 2017 01:00\“]”
}
}
Example Response:
{
"status":1,
"data":"Availability Updated",
"token":"xxxxxxx"
}
DELETE
Deletes Future Availability for a given date.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"method":"DELETE",
"module":"availability.future",
"request":{
"user":52,
"start_date":1185,
}
}
Example Response:
{
"status":1,
"data":"Future Availability Date Removed",
"token":"xxxxxxx"
}