Api doc


SDK's


Api Modules

schedule.vacation

Individual vacation management.



Supported Methods:

GET
Params
  • token (Required): valid token
  • id (Required): integer
  • force_user_timezone: enum (0, 1)


CREATE
Params
  • token (Required): valid token
  • start_date (Required): date
  • end_date (Required): date
  • employee: integer
  • comments: varchar
  • start_time: time
  • end_time: time
  • notes: varchar
  • status: varchar
  • leavetype: varchar
  • is_hourly: enum (0, 1)
  • force_user_timezone: enum (0, 1)


UPDATE
Params
  • token (Required): valid token
  • id (Required): integer
  • start_date: date
  • end_date: date
  • start_time: time
  • end_time: time
  • comments: varchar
  • notes: varchar
  • status: enum (0, 1, -1, -2)
  • force_user_timezone: enum (0, 1)
  • reason: varchar


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


Documentation

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

--

Parameters:

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

Example Request:

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

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"265",
  5. "store":"11",
  6. "date":"1336655757",
  7. "requested_on":{
  8. "id":"1107",
  9. "month":"5",
  10. "day":"10",
  11. "year":"2012",
  12. "weekday":"Thu",
  13. "mname":"May",
  14. "week":"19",
  15. "dayid":5,
  16. "formatted":"May 10, 2012"
  17. },
  18. "approved_on":"1336656212",
  19. "status":"1",
  20. "admin":"2",
  21. "comments":"",
  22. "notes":"",
  23. "start_day":{
  24. "id":"1109",
  25. "month":"5",
  26. "day":"12",
  27. "year":"2012",
  28. "weekday":"Sat",
  29. "mname":"May",
  30. "week":"19",
  31. "dayid":7,
  32. "formatted":"May 12, 2012"
  33. },
  34. "end_day":{
  35. "id":"1109",
  36. "month":"5",
  37. "day":"12",
  38. "year":"2012",
  39. "weekday":"Sat",
  40. "mname":"May",
  41. "week":"19",
  42. "dayid":7,
  43. "formatted":"May 12, 2012"
  44. },
  45. "employee":"1444",
  46. "employee_name":"Alicia",
  47. "total_days":0
  48. },
  49. "token":"xxxxxxx"
  50. }

---

CREATE
Creates an individual vacation.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "start_date": required //Start date (date)
  2. "end_date": required //End date (date)
  3. "employee": accepted //Employee id (integer)
  4. "force_user_timezone": accepted //Force User timezone (enum[0,1])
  5. /* 0: DEFAULT - forces timezone of a User who creates vacation
  6.   * 1: forces timezone of a User for whom vacation is created */
  7. "comments": accepted //Commentes (varchar)
  8. "start_time": accepted //Start time (time)
  9. "end_time": accepted //End time (time)
  10. "notes": accepted //Notes (varchar)
  11. "status": accepted //Vacation status managment (enum[-2,-1,0,1])
  12. /* 0: UN-APPROVE
  13.   * 1: APPROVE
  14.   * -1: REJECT
  15.   * -2: CANCEL */
  16. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.vacation",
  3. "method":"CREATE",
  4. "request":{
  5. "start_date":"May 19, 2012",
  6. "end_date":"May 22, 2012",
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"265",
  5. "store":"11",
  6. "date":"1336655757",
  7. "requested_on":{
  8. "id":"1107",
  9. "month":"5",
  10. "day":"10",
  11. "year":"2012",
  12. "weekday":"Thu",
  13. "mname":"May",
  14. "week":"19",
  15. "dayid":5,
  16. "formatted":"May 5, 2012"
  17. },
  18. "approved_on":"1336656212",
  19. "status":"1",
  20. "admin":"2",
  21. "comments":"",
  22. "notes":"",
  23. "start_day":{
  24. "id":"1109",
  25. "month":"5",
  26. "day":"12",
  27. "year":"2012",
  28. "weekday":"Sat",
  29. "mname":"May",
  30. "week":"19",
  31. "dayid":7,
  32. "formatted":"May 19, 2012"
  33. },
  34. "end_day":{
  35. "id":"1109",
  36. "month":"5",
  37. "day":"12",
  38. "year":"2012",
  39. "weekday":"Sat",
  40. "mname":"May",
  41. "week":"19",
  42. "dayid":7,
  43. "formatted":"May 22, 2012"
  44. },
  45. "employee":"1444",
  46. "employee_name":"Alicia",
  47. "total_days":3
  48. },
  49. "token":"xxxxxxx"
  50. }

---

UPDATE
Updates an individual vacation.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "id": required //Vacation id (integer)
  2. "start_date": accepted //Start date (date)
  3. "end_date": accepted //End date (date)
  4. "start_time": accepted //Start time (time)
  5. "end_time": accepted //End time (time)
  6. "comments": accepted //Comments (varchar)
  7. "notes": accepted //Notes (varchar)
  8. "status": accepted //Vacation status managment (enum[-2,-1,0,1])
  9. /* 0: UN-APPROVE
  10.   * 1: APPROVE
  11.   * -1: REJECT
  12.   * -2: CANCEL */
  13. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.vacation",
  3. "method":"CREATE",
  4. "request":{
  5. "start_date":"May 5, 2012",
  6. "end_date":"May 10, 2012",
  7. "comments":"Vacation",
  8. "status":"approve"
  9. }
  10. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"265",
  5. "store":"11",
  6. "date":"1336655757",
  7. "requested_on":{
  8. "id":"1107",
  9. "month":"5",
  10. "day":"10",
  11. "year":"2012",
  12. "weekday":"Thu",
  13. "mname":"May",
  14. "week":"19",
  15. "dayid":5,
  16. "formatted":"May 10, 2012"
  17. },
  18. "approved_on":"1336656212",
  19. "status":"1",
  20. "admin":"2",
  21. "comments":"",
  22. "notes":"",
  23. "start_day":{
  24. "id":"1109",
  25. "month":"5",
  26. "day":"12",
  27. "year":"2012",
  28. "weekday":"Sat",
  29. "mname":"May",
  30. "week":"19",
  31. "dayid":7,
  32. "formatted":"May 12, 2012"
  33. },
  34. "end_day":{
  35. "id":"1109",
  36. "month":"5",
  37. "day":"12",
  38. "year":"2012",
  39. "weekday":"Sat",
  40. "mname":"May",
  41. "week":"19",
  42. "dayid":7,
  43. "formatted":"May 12, 2012"
  44. },
  45. "employee":"1444",
  46. "employee_name":"Alicia",
  47. "total_days":3
  48. },
  49. "token":"xxxxxxx"
  50. }

---

DELETE
Deletes an individual vacation.
Level 5 is required (all users can fetch this module)

--

Parameters:

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

Example Request:

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

Example Response:

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