Api doc


SDK's


Api Modules

schedule.trade

Management of individual trades.



Supported Methods:

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


CREATE
Params
  • token (Required): valid token
  • shift (Required): integer
  • tradewith (Required): varchar
  • reason (Required): varchar


UPDATE
Params
  • token (Required): valid token
  • trade (Required): integer
  • action (Required): enum (activate, deactivate, cancel, accept, reject)
  • user: integer


Documentation

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

--

Parameters:

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

Example Request:

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

Example Response:

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

---

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

--

Parameters:

  1. "shift": required //Shift id (integer)
  2. "tradewith": required //Trade with - traders id (varchar)
  3. /* Array of traders ids (eg. "145,567") */
  4. "reason": required //Reason (varchar)
  5. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.trade",
  3. "method":"CREATE",
  4. "request":{
  5. "shift":"97250",
  6. "reason":"No big reason",
  7. "tradewith":"1110"
  8. }
  9. }

Example Response:

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

---

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

--

Parameters:

  1. "trade": required //Trade id (integer)
  2. "action": required //Action (enum[required,deactivate,cancel,accept,reject])
  3. /* required: Require trade
  4.   * deactivate: Deactivate trade
  5.   * cancel: Cancel trade
  6.   * accept: Accept trade
  7.   * reject: Reject trade */
  8. "user": accepted //User id (integer)
  9. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.trade",
  3. "method":"GET",
  4. "request":{
  5. "trade":"265",
  6. "action":"accept"
  7. }
  8. }

Example Response:

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

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