schedule.shift

Management of individual shifts.

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
id (required)integerShift id
detailed (accepted)integernull: Not detailed
isset: Detailed
do_not_initiate_conflicts (accepted)integer

CREATE

ParametersTypeDescription
token (required)Valid token
start_time (required)timeStart time
end_time (required)timeEnd time
start_date (required)dateStart date
end_date (required)dateEnd date
schedule (accepted)integerSchedule id
type (accepted)integer0: Shift without open slots
1: Shift with open slots (open shift)
employee_id (accepted)stringA comma-separated employee IDs which will be assigned to a shift
needed (accepted)integerNumber of needed employees
title (accepted)varcharShift title
notes (accepted)varcharNotes
confirmed (accepted)varchar"0": Not confirmed
"1": Confirmed
location (accepted)integerLocation id

UPDATE

ParametersTypeDescription
token (required)Valid token
id (required)integerShifts id
trade_accept (accepted)integer
approve_overtime (accepted)integer
employee_id (accepted)integerEmployee id
schedule (accepted)varcharSet of schedules ids

Array of schedule ids (eg. "234,563,770")
type (accepted)integer0: Shift without open slots
1: Shift with open slots (open shift)
needed (accepted)integerNumber of needed employees
start_time (accepted)timeStart time
end_time (accepted)timeEnd time
start_date (accepted)dateStart date
end_date (accepted)dateEnd date
notes (accepted)varcharNotes
title (accepted)varcharTitle
confirmed (accepted)integer"0": Not confirmed
"1": Confirmed
add (accepted)varcharA comma-separated employee IDs which will be assigned to a shift
remove (accepted)integerA comma-separated employee IDs which will be removed from a shift
detailed (accepted)varcharDetailed
isset: Detailed info
location (accepted)varcharLocation id
force (accepted)enum(0,1)Force

0: Do not force force adding
1: Force adding staff
repeat (accepted)integerRepeat (integer)
0: Do not repeat
1: Repeat daily
2: Repeat Monday-Friday
3: Repeat Monday-Thursday
4: Repeat Monday-Saturday
5: Repeat every other week
7: Repeat Weekly
9: Repeat weekend
10: Repeat Monday-Wednesday-Friday
11: Repeat Tuesday-Thursday
12: Repeat every second day
13: Repeat every month
14: Repeat every nine days
15: Repeat Tuesday-Saturday
16: Repeat every six weeks
17: Repeat every three weeks
18: Repeat every four weeks
90: Custom cycle - every n days/weeks
91: Custom cycle - n days on/n days off
92: Custom cycle - alt every n on/off
99: Custom cycle - alt every n on/off
repeat_until (accepted)dateRepeat until date
repeat_staff (accepted)enum (0,1,2)Repeat staff

1: Shift time only
2: With Employees
repeat_custom (accepted)varcharCustom repeat cycle (eg. SSSOOOO) S-Shift, O-Day off
repeat_cycle (accepted)enum (day,week)Repeat cycle

day : Repeat daily
week: Repeat weekly
repeat_cycle_step (accepted)integerRepeat cycle on

0: Repeat cycle on
1: Repeat cycle off
repeat_cycle_on (accepted)integerRepeat cycle step

Cycle step: Every n days/weeks
update_series (accepted)enum (1,2,3)Update series

1: Make all future shifts the same as this one
2: Make all shifts in the series the same as this one
3: Revert this shift to original
update_staff (accepted)enum (0,1)Update staff

0: Do not update staff
1: Update staff
update_time (accepted)enum (0,1)Update time

0: Do not update time
1: Update time
update_type (accepted)enum (0,1)Update type

0: Do not update type
1: Update type
update_notes (accepted)enum (0,1)Update notes

0: Do not update notes
1: Update notes
update_schedule (accepted)enum (0,1)Update schedule

0: Do not update schedule
1: Update schedule
update_tasks (accepted)enum (0,1)Update task
copy_to (accepted)dateCopy to date
restore (accepted)enum (0,1)Restore

0: Do not restore
1: Restore
addOnCall (accepted)integerAdd on call
removeOnCall (accepted)integerRemove on call
do_not_initiate_conflicts (accepted)integerDo not initiate conflicts

DELETE

ParametersTypeDescription
token (required)Valid token
id (required)integerShift id
rule (accepted)enum (all, following)Rule

0: all
1: following

DOCUMENTATION

GET
Retrieves an individual shift.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.shift",
   "method":"GET",
   "request":{
      "id":"409003821",
      "detailed":"1"
   }
}

Example Response:

{
  "status": 1,
  "data": {
    "id": "409003821",
    "created": "1496416510",
    "published": "1496416557",
    "edited": "1496416516",
    "deleted": "0",
    "schedule": "1068296",
    "type": "0",
    "needed": "0",
    "working": "1",
    "user": "2097936",
    "start_date": {
      "id": 2956,
      "month": 6,
      "day": 2,
      "wday": 5,
      "year": 2017,
      "weekday": "Fri",
      "mname": "Jun",
      "week": 22,
      "dayid": 6,
      "timeid": 37,
      "timeid_exact": 37,
      "formatted": "Jun 2, 2017",
      "iso8601": "2017-06-02T09:00:00+0300",
      "time": "9:00am",
      "timestamp": 1496383200,
      "hours": 9,
      "minutes": 0,
      "seconds": 0,
      "date": "2017-06-02 09:00:00",
      "day_of_year": "152",
      "week_adjusted": 22,
      "sp_wday": 6
    },
    "end_date": {
      "id": 2956,
      "month": 6,
      "day": 2,
      "wday": 5,
      "year": 2017,
      "weekday": "Fri",
      "mname": "Jun",
      "week": 22,
      "dayid": 6,
      "timeid": 69,
      "timeid_exact": 69,
      "formatted": "Jun 2, 2017",
      "iso8601": "2017-06-02T17:00:00+0300",
      "time": "5:00pm",
      "timestamp": 1496412000,
      "hours": 17,
      "minutes": 0,
      "seconds": 0,
      "date": "2017-06-02 17:00:00",
      "day_of_year": "152",
      "week_adjusted": 22,
      "sp_wday": 6
    },
    "length": 8,
    "title": "",
    "location": "0",
    "notes": " ",
    "confirmed": "0",
    "ref": "0",
    "start_timestamp": "2017-06-02 09:00:00",
    "end_timestamp": "2017-06-02 17:00:00",
    "perms": "2",
    "paidtime": 8,
    "start_time": {
      "id": 37,
      "time": "9:00am"
    },
    "end_time": {
      "id": 69,
      "time": "5:00pm"
    },
    "schedule_name": "1w -test1",
    "schedule_color": 23,
    "employees": [
      {
        "id": "2695460",
        "name": "Kimberly Moore",
        "avatar": "0",
        "status": "1",
        "wage": "",
        "last_active": "0",
        "rate": null,
        "ratecard": null,
        "present": "0",
        "cost": 0
      }
    ],
    "employeesOnCall": null,
    "cost": {
      "staff": 1,
      "hours": 8,
      "dollars": 0
    },
    "repeats": "0",
    "staff": null,
    "break": null,
    "conflicts": null,
    "conflicts_types": null,
    "conflict_types": null
  },
  "token": "xxxxxxx"
}

CREATE
Creates an individual shift.
Level 3 is required.

--

Example Request:

{
   "module":"schedule.shift",
   "method":"CREATE",
   "request":{
      "start_time":"3:00am",
      "end_time":"11:00am",
      "start_date":"May 18, 2017",
      "end_date":"May 18, 2017"
   }
}

Example Response:

{
  "status": 1,
  "data": {
    "id": 410460941,
    "created": 1497007059,
    "published": 0,
    "edited": 1497007059,
    "deleted": 0,
    "schedule": "",
    "type": 0,
    "needed": 0,
    "working": 0,
    "user": 2097936,
    "start_date": {
      "id": 2941,
      "month": 5,
      "day": 18,
      "wday": 4,
      "year": 2017,
      "weekday": "Thu",
      "mname": "May",
      "week": 20,
      "dayid": 5,
      "timeid": 13,
      "timeid_exact": 13,
      "formatted": "May 18, 2017",
      "iso8601": "2017-05-18T03:00:00+0300",
      "time": "3:00am",
      "timestamp": 1495065600,
      "hours": 3,
      "minutes": 0,
      "seconds": 0,
      "date": "2017-05-18 03:00:00",
      "day_of_year": "137",
      "week_adjusted": 20,
      "sp_wday": 5
    },
    "end_date": {
      "id": 2941,
      "month": 5,
      "day": 18,
      "wday": 4,
      "year": 2017,
      "weekday": "Thu",
      "mname": "May",
      "week": 20,
      "dayid": 5,
      "timeid": 45,
      "timeid_exact": 45,
      "formatted": "May 18, 2017",
      "iso8601": "2017-05-18T11:00:00+0300",
      "time": "11:00am",
      "timestamp": 1495094400,
      "hours": 11,
      "minutes": 0,
      "seconds": 0,
      "date": "2017-05-18 11:00:00",
      "day_of_year": "137",
      "week_adjusted": 20,
      "sp_wday": 5
    },
    "length": 8,
    "title": "",
    "location": 0,
    "notes": "",
    "confirmed": 0,
    "ref": 0,
    "start_timestamp": "2017-05-18 03:00:00",
    "end_timestamp": "2017-05-18 11:00:00",
    "perms": "2",
    "paidtime": 8,
    "start_time": {
      "id": 13,
      "time": "3:00am"
    },
    "end_time": {
      "id": 45,
      "time": "11:00am"
    },
    "schedule_name": "",
    "schedule_color": "",
    "employees": null,
    "employeesOnCall": null,
    "cost": {
      "staff": 0,
      "hours": 0,
      "dollars": 0
    },
    "repeats": 0,
    "staff": {
      "scheduled": [],
      "vacation": [
        [
          3217369,
          "0.00"
        ]
      ],
      "unavail": [],
      "overlap": [],
      "mintime": [],
      "sameday": [],
      "available": [],
      "overtime": [],
      "oncall": []
    },
    "break": 8,
    "conflicts": null,
    "conflicts_types": null,
    "conflict_types": null
  },
  "token": "xxxxxxx"
}

UPDATE
Updates an individual shift.
Level 3 is required.

--

Example Request:

{
   "module":"schedule.shift",
   "method":"UPDATE",
   "request":{
      "id":"410460941",
      "start_time":"3:00am",
      "end_time":"12:00pm",
      "start_date":"May 18, 2012",
      "end_date":"May 18, 2012"
   }
}

Example Response:

{
  "status": 1,
  "data": {
    "id": "410460941",
    "created": "1497007059",
    "published": "0",
    "edited": 1497007256,
    "deleted": "0",
    "schedule": "",
    "type": "0",
    "needed": "0",
    "working": 0,
    "user": "2097936",
    "start_date": {
      "id": 2941,
      "month": 5,
      "day": 18,
      "wday": 4,
      "year": 2017,
      "weekday": "Thu",
      "mname": "May",
      "week": 20,
      "dayid": 5,
      "timeid": 13,
      "timeid_exact": 13,
      "formatted": "May 18, 2017",
      "iso8601": "2017-05-18T03:00:00+0300",
      "time": "3:00am",
      "timestamp": 1495065600,
      "hours": 3,
      "minutes": 0,
      "seconds": 0,
      "date": "2017-05-18 03:00:00",
      "day_of_year": "137",
      "week_adjusted": 20,
      "sp_wday": 5
    },
    "end_date": {
      "id": 2941,
      "month": 5,
      "day": 18,
      "wday": 4,
      "year": 2017,
      "weekday": "Thu",
      "mname": "May",
      "week": 20,
      "dayid": 5,
      "timeid": 49,
      "timeid_exact": 49,
      "formatted": "May 18, 2017",
      "iso8601": "2017-05-18T12:00:00+0300",
      "time": "12:00pm",
      "timestamp": 1495098000,
      "hours": 12,
      "minutes": 0,
      "seconds": 0,
      "date": "2017-05-18 12:00:00",
      "day_of_year": "137",
      "week_adjusted": 20,
      "sp_wday": 5
    },
    "length": 9,
    "title": "",
    "location": "0",
    "notes": "",
    "confirmed": 0,
    "ref": "0",
    "start_timestamp": "2017-05-18 03:00:00",
    "end_timestamp": "2017-05-18 12:00:00",
    "perms": "2",
    "paidtime": 9,
    "start_time": {
      "id": 13,
      "time": "3:00am"
    },
    "end_time": {
      "id": 49,
      "time": "12:00pm"
    },
    "schedule_name": "",
    "schedule_color": "",
    "employees": null,
    "employeesOnCall": null,
    "cost": {
      "staff": 0,
      "hours": 0,
      "dollars": 0
    },
    "repeats": "0",
    "staff": {
      "scheduled": [],
      "vacation": [
        [
          3217369,
          "0.00"
        ]
      ],
      "unavail": [],
      "overlap": [],
      "mintime": [],
      "sameday": [],
      "available": [],
      "overtime": [],
      "oncall": []
    },
    "break": 9,
    "conflicts": null,
    "conflicts_types": null,
    "conflict_types": null
  },
  "token": "xxxxxxxxx"
}

DELETE
Deletes an individual shift.
Level 3 is required.

--

Example Request:

{
   "module":"schedule.shift",
   "method":"DELETE",
   "request":{
      "id":"410460941"
   }
}

Example response:

{
  "status": 1,
  "data": "Shift Removed",
  "token": "xxxxxxx"
}