Api doc


SDK's


Api Modules

schedule.shifts

Returns a list of shifts.



Supported Methods:

GET
Params
  • token (Required): valid token
  • overnight: integer
  • start_limit: integer
  • end_limit: integer
  • start_date: date
  • end_date: date
  • mode: enum (overview, location, schedule, incomplete, employees, employee, open, openapproval, confirm, onnow, late, upcoming, recent)
  • tc_on: integer
  • schedule: varchar
  • location: integer
  • employees: varchar
  • detailed: integer
  • budget: enum (0, 1)
  • vacation: enum (0, 1)
  • fm: enum (0, 1)
  • filter_by_site: varchar
  • filter_by_employee: varchar
  • filter_by_skill: varchar
  • filled: enum (0, 1)
  • include_ghost_shifts: enum (0, 1)


Documentation

GET
Retrieves a list of shifts.
Level 5 is required

--

Parameters:

  1. "start_limit": accepted /*Start limit (integer)
  2.   *Pagination offset */
  3. "end_limit": accepted /*End limit (integer)
  4.   *Pagination - max number of entries per page */
  5. "start_date": accepted //Start date (date)
  6. "end_date": accepted //End date (date)
  7. "mode": accepted /*Mode (enum[overview,location,schedule,incomplete,employees
  8.   * employee,open,openapproval,confirm,onnow,late])
  9.   * overview
  10.   * location
  11.   * schedule
  12.   * incomplete
  13.   * employees
  14.   * employee
  15.   * open
  16.   * openapproval
  17.   * confirm
  18.   * onnow
  19.   * late */
  20. "location": accepted //Location id (integer)
  21. "tc_on": accepted /*Timeclock on (integer)
  22.   * null : Timeclock off
  23.   * isset: Timeclock on */
  24. "schedule": accepted /*Schedule (varchar)
  25.   * Array of schedule ids (eg. "234,563,770") */
  26. "employees": accepted /*Employees (varchar)
  27.   * Array of employees ids (eg. "234,563,770") */
  28. "detailed": accepted /*Detailed (enum[0,1])
  29.   * 0: Not detailed
  30.   * 1: Detailed */
  31. "budget": accepted /*Budget (enum[0,1])
  32.   * 0: Do not grab budget data
  33.   * 1: Grab budget data */
  34. "vacation": accepted /*Vacation (enum[0,1])
  35.   * 0: Do not show vacation data
  36.   * 1: Show vacation data */
  37. "fm": accepted /*Force mater database (enum[0,1])
  38.   *Results will be the same with or without this param
  39.   *The difference is that it forces data writing into
  40.   *the master database before slave database*/
  41. "filter_by_site": accepted //Filter by remote site (varchar)
  42. "filter_by_employee": accepted //Filter by employee (varchar)
  43. "filter_by_skill": accepted //Filter by skill (varchar)
  44. "filled": accepted //Filled param for open shifts enum(0,1)
  45.  
  46. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.shifts",
  3. "method":"GET",
  4. "request":{
  5. "start_date":"Jul 7, 2013",
  6. "end_date":"Jul 13, 2013",
  7. "mode":"overview"
  8. }
  9. }

Example Response:

  1. {
  2. "status": 1,
  3. "token": "xxxxxxx",
  4. "data": [
  5. {
  6. "paidtime": 5,
  7. "confirmed_end_timestamp": null,
  8. "location": "0",
  9. "working": "0",
  10. "end_date": {
  11. "day_of_year": "190",
  12. "formatted": "Jul 10, 2013",
  13. "week_adjusted": 1,
  14. "timestamp": 1373500800,
  15. "weekday": "Wed",
  16. "mname": "Jul",
  17. "time": "5:00pm",
  18. "sp_wday": 4,
  19. "year": 2013,
  20. "wday": 3,
  21. "seconds": 0,
  22. "id": 1533,
  23. "dayid": 4,
  24. "week": 28,
  25. "minutes": 0,
  26. "day": 10,
  27. "timeid": 69,
  28. "hours": 17,
  29. "date": "2013-07-10 17:00:00",
  30. "month": 7,
  31. "timeid_exact": 69
  32. },
  33. "edited": "1373248531",
  34. "start_date": {
  35. "day_of_year": "190",
  36. "formatted": "Jul 10, 2013",
  37. "week_adjusted": 1,
  38. "timestamp": 1373482800,
  39. "weekday": "Wed",
  40. "mname": "Jul",
  41. "time": "12:00pm",
  42. "sp_wday": 4,
  43. "year": 2013,
  44. "wday": 3,
  45. "seconds": 0,
  46. "id": 1533,
  47. "dayid": 4,
  48. "week": 28,
  49. "minutes": 0,
  50. "day": 10,
  51. "timeid": 49,
  52. "hours": 12,
  53. "date": "2013-07-10 12:00:00",
  54. "month": 7,
  55. "timeid_exact": 49
  56. },
  57. "requests": [{
  58. "flag": "0",
  59. "name": "Fry",
  60. "request_id": "604785",
  61. "id": "240420"
  62. }],
  63. "type": "1",
  64. "length": 5,
  65. "ref": "0",
  66. "created": "1373248525",
  67. "repeats": "0",
  68. "start_timestamp": "2013-07-10 12:00:00",
  69. "confirmed_start_timestamp": null,
  70. "needed": "4",
  71. "end_time": {
  72. "time": "5:00pm",
  73. "id": 69
  74. },
  75. "schedule_color": "17",
  76. "notes": "",
  77. "deleted": "0",
  78. "start_time": {
  79. "time": "12:00pm",
  80. "id": 49
  81. },
  82. "end_timestamp": "2013-07-10 17:00:00",
  83. "traded": null,
  84. "id": "13251137",
  85. "confirmed": "0",
  86. "schedule_name": "Space",
  87. "cost": {
  88. "staff": 0,
  89. "dollars": 0,
  90. "hours": 0
  91. },
  92. "schedule": "134796",
  93. "perms": "2",
  94. "published": "1373362618",
  95. "title": "",
  96. "user": "240416"
  97. },
  98. {
  99. "paidtime": 4,
  100. "confirmed_end_timestamp": null,
  101. "location": "0",
  102. "working": "1",
  103. "end_date": {
  104. "day_of_year": "191",
  105. "formatted": "Jul 11, 2013",
  106. "week_adjusted": 1,
  107. "timestamp": 1373583600,
  108. "weekday": "Thu",
  109. "mname": "Jul",
  110. "time": "4:00pm",
  111. "sp_wday": 5,
  112. "year": 2013,
  113. "wday": 4,
  114. "seconds": 0,
  115. "id": 1534,
  116. "dayid": 5,
  117. "week": 28,
  118. "minutes": 0,
  119. "day": 11,
  120. "timeid": 65,
  121. "hours": 16,
  122. "date": "2013-07-11 16:00:00",
  123. "month": 7,
  124. "timeid_exact": 65
  125. },
  126. "edited": "1373362614",
  127. "start_date": {
  128. "day_of_year": "191",
  129. "formatted": "Jul 11, 2013",
  130. "week_adjusted": 1,
  131. "timestamp": 1373569200,
  132. "weekday": "Thu",
  133. "mname": "Jul",
  134. "time": "12:00pm",
  135. "sp_wday": 5,
  136. "year": 2013,
  137. "wday": 4,
  138. "seconds": 0,
  139. "id": 1534,
  140. "dayid": 5,
  141. "week": 28,
  142. "minutes": 0,
  143. "day": 11,
  144. "timeid": 49,
  145. "hours": 12,
  146. "date": "2013-07-11 12:00:00",
  147. "month": 7,
  148. "timeid_exact": 49
  149. },
  150. "type": "0",
  151. "length": 4,
  152. "ref": "0",
  153. "created": "1373362614",
  154. "employees": [{
  155. "name": "Amy",
  156. "id": "240423",
  157. "confirmed_end": null,
  158. "cost": 80,
  159. "last_active": "1372148963",
  160. "ratecard": "10758",
  161. "notified_day": "0",
  162. "confirmed_start": null,
  163. "status": "1",
  164. "notified_hour": "0",
  165. "rate": "20",
  166. "avatar": "1348494821",
  167. "wage": "0"
  168. }],
  169. "repeats": "0",
  170. "start_timestamp": "2013-07-11 12:00:00",
  171. "confirmed_start_timestamp": null,
  172. "needed": "0",
  173. "end_time": {
  174. "time": "4:00pm",
  175. "id": 65
  176. },
  177. "schedule_color": "23",
  178. "notes": "",
  179. "deleted": "0",
  180. "start_time": {
  181. "time": "12:00pm",
  182. "id": 49
  183. },
  184. "end_timestamp": "2013-07-11 16:00:00",
  185. "traded": "0",
  186. "id": "13251185",
  187. "confirmed": "0",
  188. "schedule_name": "Office",
  189. "cost": {
  190. "staff": 1,
  191. "dollars": 80,
  192. "hours": 4
  193. },
  194. "schedule": "134795",
  195. "perms": "2",
  196. "published": "1373362618",
  197. "title": "",
  198. "user": "240712"
  199. }
  200. ]
  201. }