Api doc


SDK's


Api Modules

availability.future

Returns Future Availability for a given day time period



Supported Methods:

GET
Params
  • token (Required): valid token
  • user: integer
  • approved: enum (0, 1)
  • start_date: date
  • end_date: date


CREATE
Params
  • token (Required): valid token
  • start_date (Required): date
  • user: integer


UPDATE
Params
  • token (Required): valid token
  • id (Required): integer
  • flag (Required): enum (1, 2, 3)
  • times: enum (Array)
  • time_type: min length 1


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


Documentation

GET
Returns Future Availability for a given day time period.
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 (enum[0,1])
  3. /* 0: Unapproved
  4.   * 1: Approved */
  5. "start_date": accepted //Start date (date)
  6. "end_date": accepted //End date (date)
  7.  
  8. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"GET",
  3. "module":"availability.future",
  4. "request":{
  5. "start_date":"Jul 20, 2012",
  6. "end_date":"Jul 20, 2012"
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "1183":{
  5. "date":{
  6. "id":"1183",
  7. "month":"7",
  8. "day":"25",
  9. "year":"2012",
  10. "weekday":"Wed",
  11. "mname":"Jul",
  12. "week":"30",
  13. "dayid":4,
  14. "formatted":"Jul 25, 2012"
  15. },
  16. "availability":{
  17. "1":{
  18. "flag":"1",
  19. "time":"00:00"
  20. },
  21. "2":{
  22. "flag":"1",
  23. "time":"00:15"
  24. },
  25. "3":{
  26. "flag":"1",
  27. "time":"00:30"
  28. },
  29. "4":{
  30. "flag":"1",
  31. "time":"00:45"
  32. },
  33. "49":{
  34. "flag":"1",
  35. "time":"12:00"
  36. },
  37. "50":{
  38. "flag":"1",
  39. "time":"12:15"
  40. },
  41. "51":{
  42. "flag":"1",
  43. "time":"12:30"
  44. },
  45. "52":{
  46. "flag":"1",
  47. "time":"12:45"
  48. }
  49. },
  50. "approved":"0",
  51. "approved_by":"0",
  52. "times":"00:00-01:00, 12:00-13:00"
  53. },
  54. "1184":{
  55. "date":{
  56. "id":"1184",
  57. "month":"7",
  58. "day":"26",
  59. "year":"2012",
  60. "weekday":"Thu",
  61. "mname":"Jul",
  62. "week":"30",
  63. "dayid":5,
  64. "formatted":"Jul 26, 2012"
  65. },
  66. "availability":{
  67. "17":{
  68. "flag":"1",
  69. "time":"04:00"
  70. },
  71. "18":{
  72. "flag":"1",
  73. "time":"04:15"
  74. },
  75. "19":{
  76. "flag":"1",
  77. "time":"04:30"
  78. },
  79. "20":{
  80. "flag":"1",
  81. "time":"04:45"
  82. },
  83. "21":{
  84. "flag":"1",
  85. "time":"05:00"
  86. },
  87. "22":{
  88. "flag":"1",
  89. "time":"05:15"
  90. },
  91. "23":{
  92. "flag":"1",
  93. "time":"05:30"
  94. },
  95. "24":{
  96. "flag":"1",
  97. "time":"05:45"
  98. },
  99. "25":{
  100. "flag":"1",
  101. "time":"06:00"
  102. },
  103. "26":{
  104. "flag":"1",
  105. "time":"06:15"
  106. },
  107. "27":{
  108. "flag":"1",
  109. "time":"06:30"
  110. },
  111. "28":{
  112. "flag":"1",
  113. "time":"06:45"
  114. },
  115. "29":{
  116. "flag":"1",
  117. "time":"07:00"
  118. },
  119. "30":{
  120. "flag":"1",
  121. "time":"07:15"
  122. },
  123. "31":{
  124. "flag":"1",
  125. "time":"07:30"
  126. },
  127. "32":{
  128. "flag":"1",
  129. "time":"07:45"
  130. },
  131. "33":{
  132. "flag":"1",
  133. "time":"08:00"
  134. },
  135. "34":{
  136. "flag":"1",
  137. "time":"08:15"
  138. },
  139. "35":{
  140. "flag":"1",
  141. "time":"08:30"
  142. },
  143. "36":{
  144. "flag":"1",
  145. "time":"08:45"
  146. }
  147. },
  148. "approved":"0",
  149. "approved_by":"0",
  150. "times":"04:00-09:00"
  151. }
  152. },
  153. "token":"xxxxxxx"
  154. }

---

CREATE
Create Future Availability for a given date.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "start_date": required //Start date (date)
  2. "user": accepted //User id (integer)
  3. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"CREATE",
  3. "module":"availability.future",
  4. "request":{
  5. "user":52,
  6. "start_date":"27-07-2012"
  7. }
  8. }

Example Response:

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

---

UPDATE
Update Future Availability for a given date and time.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "start_date": required //Start date (date)
  2. "start_time": required //Start time (time)
  3. "end_time": required //End time (time)
  4. "flag": required //Flag (enum[1,2,3])
  5. /* 1: Unavailable,
  6.   * 2: Available,
  7.   * 3: Wants to work */
  8. "user": accepted //User id (integer)
  9. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"UPDATE",
  3. "module":"availability.future",
  4. "request":{
  5. "user":52,
  6. "start_date":1185,
  7. "start_time":17,
  8. "end_time":20,
  9. "flag":1
  10. }
  11. }

Example Response:

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

---

DELETE
Deletes Future Availability for a given date.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "start_date": required //Start date (date)
  2. "user": accepted //User id (integer)
  3. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "method":"DELETE",
  3. "module":"availability.future",
  4. "request":{
  5. "user":52,
  6. "start_date":1185,
  7. }
  8. }

Example Response:

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