Api doc


SDK's


Api Modules

availability.weekly

Returns Weekly Availability for a user



Supported Methods:

GET
Params
  • token (Required): valid token
  • user: integer
  • approved: min length 1
  • day: enum (1, 2, 3, 4, 5, 6, 7)
  • timeframe: min length 1


UPDATE
Params
  • token (Required): valid token
  • flag (Required): enum (1, 2, 3)
  • user: integer
  • day: enum (1, 2, 3, 4, 5, 6, 7)
  • start_time: time
  • end_time: time
  • intervals: enum (Array)


DELETE
Params
  • token (Required): valid token
  • start_time (Required): time
  • end_time (Required): time
  • user: integer


Documentation

GET
Returns Weekly Availability for a user.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "user": accepted //User id (integer)
  2. "approved":accepted //Filter unapproved or approved availability (int) - Min length 1
  3. /* 0: Unapproved
  4.   * 1: Approved */
  5. "day":accepted //Day of the week (enum[1,2,3,4,5,6,7])
  6. /* 1: Sunday
  7.   * 2: Monday
  8.   * 3: Tuesday
  9.   * 4: Wednesday
  10.   * 5: Thursday
  11.   * 6: Friday
  12.   * 7: Saturday */
  13. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"GET",
  3. "module":"availability.weekly",
  4. "request":{
  5. "user":1548,
  6. "day":1
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"1",
  5. "day":"Sun",
  6. "availability":[
  7. {
  8. "flag":"1",
  9. "approved":"0"
  10. },
  11. {
  12. "flag":"1",
  13. "approved":"0"
  14. },
  15. {
  16. "flag":"1",
  17. "approved":"0"
  18. },
  19. {
  20. "flag":"1",
  21. "approved":"0"
  22. },
  23. {
  24. "flag":"1",
  25. "approved":"0"
  26. },
  27. {
  28. "flag":"1",
  29. "approved":"0"
  30. },
  31. {
  32. "flag":"1",
  33. "approved":"0"
  34. },
  35. {
  36. "flag":"1",
  37. "approved":"0"
  38. },
  39. {
  40. "flag":"1",
  41. "approved":"0"
  42. },
  43. {
  44. "flag":"1",
  45. "approved":"0"
  46. }
  47. ]
  48. },
  49. "token":"xxxxxxx"
  50. }

---

UPDATE
Updates Weekly Availability for a user.
Level 5 is required

--

Parameters:

  1. "flag": required //Availability flag (enum[1,2,3])
  2. /* 1: Unavailable
  3.   * 2: Available
  4.   * 3: Changed */
  5. "user": accepted //User id (integer)
  6. "intervals": required /* Availability interval,
  7.   json {"date_id":["start_time_id", "end_time_id"]}
  8.   Parameters "start_time_id" and "end_time_id" can take
  9.   values from 1 to 96
  10.   (24 hours splitted into 15 min intervals) */
  11. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"UPDATE",
  3. "module":"availability.weekly",
  4. "request":{
  5. "flag":"1",
  6. "user":"xxxxxx",
  7. "intervals": {"1":["1","7"],"2":["8","12"]}
  8. }
  9. }

Example Response:

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

---

DELETE
Deletes Weekly Availability for a user.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "start_time": required //Start time (time)
  2. "end_time": required //End time (time)
  3. "user": accepted //User id (integer)
  4. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"DELETE",
  3. "module":"availability.weekly",
  4. "request":{
  5. "start_time":1,
  6. "end_time":5,
  7. }
  8. }

Example Response:

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

GET STARTED NOW

Free Trial. No Credit Card Required.

close
(e.g.+14158675309 or +1415-8675-309)

By clicking "Create my ShiftPlanning Account" you agree to the Terms of Service and Privacy Policy.

Have a promotional code?Click Here


LIVE CHAT DEMO REQUEST!

Please provide information below.

close
INSTANT DEMOSCHEDULED DEMO
Connect with a ShiftPlanning Team Member for a live demo right now!
 

RESELLER REQUEST!

Please provide information below.

close