availability.future

Returns Future Availability for a given day time period

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
user (accepted)integerUser id
approved (accepted)enum (0, 1)0: Unapproved
1: Approved
start_date (accepted)dateStart date
end_date (accepted)dateEnd date

CREATE

ParametersTypeDescription
token (required)Valid token
start_date (required)dateStart date
user (accepted)integerUser id

UPDATE

ParametersTypeDescription
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

ParametersTypeDescription
token (required)Valid token
user (accepted)integerUser id
start_date (required)dateStart 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"
}