Api doc


SDK's


Api Modules

schedule.trades

Returns a list of trades.



Supported Methods:

GET
Params
  • token (Required): valid token
  • mode: enum (manage, requested, swap)


Documentation

GET
Retrieves a list of trades.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "mode": accepted //Mode (enum[manage,requested])
  2. /* manage: Manage trades
  3.   * requested: Requested trades */
  4. "token": "xxxxxxx" //Valid token is required

Example Request:

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

Example Response:

  1. {
  2. "status":1,
  3. "data":[
  4. {
  5. "id":"238",
  6. "status":"0",
  7. "user":"5144",
  8. "shift":"94220",
  9. "store":"11",
  10. "reference":null,
  11. "reason":"No big reason",
  12. "date":"1339498178",
  13. "confirm_before":"0",
  14. "confirm_after":"0",
  15. "trade_to":"0",
  16. "shift_start_date":{
  17. "id":"1150",
  18. "month":"6",
  19. "day":"22",
  20. "year":"2012",
  21. "weekday":"Fri",
  22. "mname":"Jun",
  23. "week":"25",
  24. "dayid":6,
  25. "formatted":"Jun 22, 2012"
  26. },
  27. "shift_start":"33",
  28. "shift_end":"73",
  29. "shift_schedule":"33499",
  30. "schedule_name":"Budget 1",
  31. "user_name":"Andy",
  32. "requested":{
  33. "id":"1140",
  34. "month":"6",
  35. "day":"12",
  36. "year":"2012",
  37. "weekday":"Tue",
  38. "mname":"Jun",
  39. "week":"24",
  40. "dayid":3,
  41. "formatted":"Jun 12, 2012"
  42. },
  43. "shift_start_time":"8 am",
  44. "shift_end_time":"6 pm",
  45. "traders":{
  46. "count":2,
  47. "data":[
  48. {
  49. "id":"2297",
  50. "trade_id":"238",
  51. "shift":"94220",
  52. "user":"5145",
  53. "confirmed":"0",
  54. "approved":"0",
  55. "sms":"0",
  56. "email":"0",
  57. "online":"0",
  58. "user_name":"Bond"
  59. },
  60. {
  61. "id":"2298",
  62. "trade_id":"238",
  63. "shift":"94220",
  64. "user":"5245",
  65. "confirmed":"0",
  66. "approved":"0",
  67. "sms":"0",
  68. "email":"0",
  69. "online":"0",
  70. "user_name":"Ian Graham"
  71. }
  72. ]
  73. }
  74. }
  75. ],
  76. "token":"xxxxxxx"
  77. }