Api doc


SDK's


Api Modules

schedule.shiftapprove

Management of individual shifts.



Supported Methods:

GET
Params
  • token (Required): valid token
  • id (Required): integer


CREATE
Params
  • token (Required): valid token
  • id (Required): integer


UPDATE
Params
  • token (Required): valid token
  • employee: integer
  • id: integer
  • shift_ids: varchar
  • absent: enum (0, 1)
  • start_time: time
  • end_time: time
  • start_date: date
  • end_date: date


DELETE
Params
  • token (Required): valid token
  • id (Required): integer


Documentation

GET
Retrieves an individual shift that needs approval.
Level 3 is required.

--

Parameters:

  1. "id": required //Shift id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.shiftapprove",
  3. "method":"GET",
  4. "request":{
  5. "id":"94147"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"94147",
  5. "created":"1338293250",
  6. "published":"1338345621",
  7. "edited":"1338293250",
  8. "deleted":"0",
  9. "schedule":"32409",
  10. "type":"0",
  11. "needed":"0",
  12. "working":"1",
  13. "user":"2",
  14. "start_date":{
  15. "id":"1126",
  16. "month":"5",
  17. "day":"29",
  18. "year":"2012",
  19. "weekday":"Tue",
  20. "mname":"May",
  21. "week":"22",
  22. "dayid":3,
  23. "formatted":"May 29, 2012"
  24. },
  25. "end_date":{
  26. "id":"1126",
  27. "month":"5",
  28. "day":"29",
  29. "year":"2012",
  30. "weekday":"Tue",
  31. "mname":"May",
  32. "week":"22",
  33. "dayid":3,
  34. "formatted":"May 29, 2012"
  35. },
  36. "length":8,
  37. "title":"",
  38. "location":"0",
  39. "notes":"",
  40. "confirmed":"0",
  41. "perms":"2",
  42. "paidtime":"8",
  43. "start_time":{
  44. "id":"33",
  45. "time":"08:00"
  46. },
  47. "end_time":{
  48. "id":"65",
  49. "time":"16:00"
  50. },
  51. "schedule_name":"Break Cover",
  52. "employees":[
  53. {
  54. "id":"3820",
  55. "name":"Aly",
  56. "status":"1",
  57. "wage":"10",
  58. "notified_day":"0",
  59. "notified_hour":"0",
  60. "last_active":"1338389744",
  61. "rate":"",
  62. "ratecard":"0",
  63. "cost":"80.00"
  64. }
  65. ],
  66. "cost":{
  67. "staff":1,
  68. "hours":8,
  69. "dollars":80
  70. },
  71. "repeats":"0",
  72. "staff":{
  73. "scheduled":[
  74. {
  75. "3820":"18.00"
  76. }
  77. ],
  78. "available":[
  79. {
  80. "4910":"10.00"
  81. },
  82. {
  83. "5215":"10.00"
  84. },
  85. {
  86. "1063":"0.00"
  87. },
  88. {
  89. "5412":"0.00"
  90. },
  91. {
  92. "5216":"0.00"
  93. }
  94. ],
  95. "sameday":null,
  96. "mintime":null,
  97. "overlap":[
  98. {
  99. "5141":"14.00"
  100. }
  101. ],
  102. "unavail":null,
  103. "vacation":[
  104. {
  105. "5019":"0.00"
  106. },
  107. {
  108. "4944":"0.00"
  109. }
  110. ],
  111. "overtime":null
  112. },
  113. "break":8,
  114. "conflicts":false
  115. },
  116. "token":"xxxxxxx"
  117. }

---

CREATE
Confirms an individual shift.
Level 3 is required.

--

Parameters:

  1. "id": required //Shift id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.shiftapprove",
  3. "method":"CREATE",
  4. "request":{
  5. "id":"94147"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"94147",
  5. "created":"1338293250",
  6. "published":"1338345621",
  7. "edited":"1338293250",
  8. "deleted":"0",
  9. "schedule":"32409",
  10. "type":"0",
  11. "needed":"0",
  12. "working":"1",
  13. "user":"2",
  14. "start_date":{
  15. "id":"1126",
  16. "month":"5",
  17. "day":"29",
  18. "year":"2012",
  19. "weekday":"Tue",
  20. "mname":"May",
  21. "week":"22",
  22. "dayid":3,
  23. "formatted":"May 29, 2012"
  24. },
  25. "end_date":{
  26. "id":"1126",
  27. "month":"5",
  28. "day":"29",
  29. "year":"2012",
  30. "weekday":"Tue",
  31. "mname":"May",
  32. "week":"22",
  33. "dayid":3,
  34. "formatted":"May 29, 2012"
  35. },
  36. "length":8,
  37. "title":"",
  38. "location":"0",
  39. "notes":"",
  40. "confirmed":"0",
  41. "perms":"2",
  42. "paidtime":"8",
  43. "start_time":{
  44. "id":"33",
  45. "time":"08:00"
  46. },
  47. "end_time":{
  48. "id":"65",
  49. "time":"16:00"
  50. },
  51. "schedule_name":"Break Cover",
  52. "employees":[
  53. {
  54. "id":"3820",
  55. "name":"Aly",
  56. "status":"1",
  57. "wage":"10",
  58. "notified_day":"0",
  59. "notified_hour":"0",
  60. "last_active":"1338389744",
  61. "rate":"",
  62. "ratecard":"0",
  63. "cost":"80.00"
  64. }
  65. ],
  66. "cost":{
  67. "staff":1,
  68. "hours":8,
  69. "dollars":80
  70. },
  71. "repeats":"0",
  72. "staff":{
  73. "scheduled":[
  74. {
  75. "3820":"18.00"
  76. }
  77. ],
  78. "available":[
  79. {
  80. "4910":"10.00"
  81. },
  82. {
  83. "5215":"10.00"
  84. },
  85. {
  86. "1063":"0.00"
  87. },
  88. {
  89. "5412":"0.00"
  90. },
  91. {
  92. "5216":"0.00"
  93. }
  94. ],
  95. "sameday":null,
  96. "mintime":null,
  97. "overlap":[
  98. {
  99. "5141":"14.00"
  100. }
  101. ],
  102. "unavail":null,
  103. "vacation":[
  104. {
  105. "5019":"0.00"
  106. },
  107. {
  108. "4944":"0.00"
  109. }
  110. ],
  111. "overtime":null
  112. },
  113. "break":8,
  114. "conflicts":false
  115. },
  116. "token":"xxxxxxx"
  117. }

---

UPDATE
Updates an individual shift.
Level 3 is required.

--

Parameters:

  1. "id": required //Shifts id (integer)
  2. "employee": accepted //Employee id (integer)
  3. "absent": accepted //Absent (enum[0,1])
  4. /* 0: Not absent
  5.   * 1: Absent */
  6. "start_time": accepted //Start time (time)
  7. "end_time": accepted //End time (time)
  8. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.shiftapprove",
  3. "method":"UPDATE",
  4. "request":{
  5. "id":"94147",
  6. "end_time":"11am"
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"94147",
  5. "created":"1338293250",
  6. "published":"1338345621",
  7. "edited":"1338293250",
  8. "deleted":"0",
  9. "schedule":"32409",
  10. "type":"0",
  11. "needed":"0",
  12. "working":"1",
  13. "user":"2",
  14. "start_date":{
  15. "id":"1126",
  16. "month":"5",
  17. "day":"29",
  18. "year":"2012",
  19. "weekday":"Tue",
  20. "mname":"May",
  21. "week":"22",
  22. "dayid":3,
  23. "formatted":"May 29, 2012"
  24. },
  25. "end_date":{
  26. "id":"1126",
  27. "month":"5",
  28. "day":"29",
  29. "year":"2012",
  30. "weekday":"Tue",
  31. "mname":"May",
  32. "week":"22",
  33. "dayid":3,
  34. "formatted":"May 29, 2012"
  35. },
  36. "length":8,
  37. "title":"",
  38. "location":"0",
  39. "notes":"",
  40. "confirmed":"0",
  41. "perms":"2",
  42. "paidtime":"8",
  43. "start_time":{
  44. "id":"33",
  45. "time":"08:00"
  46. },
  47. "end_time":{
  48. "id":"65",
  49. "time":"16:00"
  50. },
  51. "schedule_name":"Break Cover",
  52. "employees":[
  53. {
  54. "id":"3820",
  55. "name":"Aly",
  56. "status":"1",
  57. "wage":"10",
  58. "notified_day":"0",
  59. "notified_hour":"0",
  60. "last_active":"1338389744",
  61. "rate":"",
  62. "ratecard":"0",
  63. "cost":"80.00"
  64. }
  65. ],
  66. "cost":{
  67. "staff":1,
  68. "hours":8,
  69. "dollars":80
  70. },
  71. "repeats":"0",
  72. "staff":{
  73. "scheduled":[
  74. {
  75. "3820":"18.00"
  76. }
  77. ],
  78. "available":[
  79. {
  80. "4910":"10.00"
  81. },
  82. {
  83. "5215":"10.00"
  84. },
  85. {
  86. "1063":"0.00"
  87. },
  88. {
  89. "5412":"0.00"
  90. },
  91. {
  92. "5216":"0.00"
  93. }
  94. ],
  95. "sameday":null,
  96. "mintime":null,
  97. "overlap":[
  98. {
  99. "5141":"14.00"
  100. }
  101. ],
  102. "unavail":null,
  103. "vacation":[
  104. {
  105. "5019":"0.00"
  106. },
  107. {
  108. "4944":"0.00"
  109. }
  110. ],
  111. "overtime":null
  112. },
  113. "break":8,
  114. "conflicts":false
  115. },
  116. "token":"xxxxxxx"
  117. }

---

DELETE
Unconfirm an individual shift.
Level 3 is required.

--

Parameters:

  1. "id": required //Shifts id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.shiftapprove",
  3. "method":"DELETE",
  4. "request":{
  5. "id":"94147"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":"",
  4. "token":"xxxxxxx"
  5. }