Api doc


SDK's


Api Modules

timeclock.timeclock

Management of individual Clock Times.



Supported Methods:

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


CREATE
Params
  • token (Required): valid token
  • start_date (Required): date
  • employee (Required): integer
  • start_time (Required): time
  • end_date: date
  • end_time: time
  • notes: varchar
  • tips: varchar
  • schedule: integer
  • approved: enum (0, 1)
  • unique_id: varchar
  • in_location: varchar
  • out_location: varchar


UPDATE
Params
  • token (Required): valid token
  • id: integer
  • unique_id: varchar
  • start_date: date
  • end_date: date
  • schedule: integer
  • employee: integer
  • start_time: time
  • end_time: time
  • notes: varchar
  • approved: enum (0, 1)
  • tips: varchar


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


Documentation

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

--

Parameters:

  1. "id": required //Individual clock time id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"timeclock.timeclock",
  3. "method":"GET",
  4. "request":{
  5. "id":"15553"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"878",
  5. "status":"0",
  6. "schedule":{
  7. "id":"32408",
  8. "name":"Admin\/meetings"
  9. },
  10. "notes":"",
  11. "in_timestamp":"1336863600",
  12. "out_timestamp":"1337421600",
  13. "in_location":"Website",
  14. "out_location":"Website",
  15. "approved_by":"2",
  16. "approved_time":"1337035217",
  17. "approved_notes":"",
  18. "in_picture":null,
  19. "out_picture":"",
  20. "employee":{
  21. "id":"5146",
  22. "name":"Candy"
  23. },
  24. "in_time":{
  25. "time":"7:00pm",
  26. "day":"May 12, 2012"
  27. },
  28. "length":{
  29. "hours":155,
  30. "mins":0,
  31. "total_hours":"155.00"
  32. },
  33. "out_time":{
  34. "time":"6:00am",
  35. "day":"May 19, 2012"
  36. }
  37. },
  38. "token":"xxxxxxx"
  39. }

---

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

--

Parameters:

  1. "start_date": required //Start date (date)
  2. "schedule": required //Schedule id (integer)
  3. "employee": required //Employee id (integer)
  4. "start_time": required //Start time (time)
  5. "end_date": accepted //End date (date)
  6. "end_time": accepted //End date (date)
  7. "notes": accepted //Notes (varchar)
  8. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"timeclock.timeclock",
  3. "method":"CREATE",
  4. "request":{
  5. "start_date":"May 19, 2012",
  6. "schedule":"199",
  7. "employee":"1143",
  8. "start_time":"3:05"
  9. }
  10. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"878",
  5. "status":"0",
  6. "schedule":{
  7. "id":"32408",
  8. "name":"Admin\/meetings"
  9. },
  10. "notes":"",
  11. "in_timestamp":"1336863600",
  12. "out_timestamp":"1337421600",
  13. "in_location":"Website",
  14. "out_location":"Website",
  15. "approved_by":"2",
  16. "approved_time":"1337035217",
  17. "approved_notes":"",
  18. "in_picture":null,
  19. "out_picture":"",
  20. "employee":{
  21. "id":"1143",
  22. "name":"Candy"
  23. },
  24. "in_time":{
  25. "time":"7:00pm",
  26. "day":"May 12, 2012"
  27. },
  28. "length":{
  29. "hours":155,
  30. "mins":0,
  31. "total_hours":"155.00"
  32. },
  33. "out_time":{
  34. "time":"6:00am",
  35. "day":"May 19, 2012"
  36. }
  37. },
  38. "token":"xxxxxxx"
  39. }

---

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

--

Parameters:

  1. "id": required //Timeclock id (integer)
  2. "start_date": accepted //Start date (date)
  3. "end_date": accepted //End date (date)
  4. "schedule": accepted //Schedule id (integer)
  5. "employee": accepted //Employee id (integer)
  6. "start_time": accepted //Start time (time)
  7. "end_time": accepted //End date (date)
  8. "notes": accepted //Notes (varchar)
  9. "approved": accepted //Approved (enum[0,1])
  10. /* 0: Unapproved
  11.   * 1: Approved */
  12. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"timeclock.timeclock",
  3. "method":"UPDATE",
  4. "request":{
  5. "id":"878",
  6. "start_date":"May 19, 2012",
  7. "start_time":"3:05"
  8. }
  9. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"878",
  5. "status":"0",
  6. "schedule":{
  7. "id":"32408",
  8. "name":"Admin\/meetings"
  9. },
  10. "notes":"",
  11. "in_timestamp":"1336863600",
  12. "out_timestamp":"1337421600",
  13. "in_location":"Website",
  14. "out_location":"Website",
  15. "approved_by":"2",
  16. "approved_time":"1337035217",
  17. "approved_notes":"",
  18. "in_picture":null,
  19. "out_picture":"",
  20. "employee":{
  21. "id":"1143",
  22. "name":"Candy"
  23. },
  24. "in_time":{
  25. "time":"3:05pm",
  26. "day":"May 12, 2012"
  27. },
  28. "length":{
  29. "hours":155,
  30. "mins":0,
  31. "total_hours":"155.00"
  32. },
  33. "out_time":{
  34. "time":"6:00am",
  35. "day":"May 19, 2012"
  36. }
  37. },
  38. "token":"xxxxxxx"
  39. }

---

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

--

Parameters:

  1. "id": required //Individual clock time id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"timeclock.timeclock",
  3. "method":"DELETE",
  4. "request":{
  5. "id":"878"
  6. }
  7. }

Example Response:

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