Api doc


SDK's


Api Modules

schedule.tradeswap



Supported Methods:

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


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


Documentation

CREATE
Creates an individual swap shift request.
Level 5 is required.

--

Parameters:

  1. "shift": required //Shift id (integer)
  2. "swap": required //Shifts to trade with (varchar)
  3. /* Array of user_shift_id's (eg. "1435,5667")
  4.   * you get user_shift_id with schedule.tradelist
  5.   * and swap bit set to 1 */
  6. "reason": required //Reason (varchar)
  7. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"schedule.tradeswap",
  3. "method":"CREATE",
  4. "request":{
  5. "shift":"13221461",
  6. "reason":"No big reason",
  7. "swap":"13221462,13221463"
  8. }
  9. }

Example Response:

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

---

UPDATE
Updates an individual swap shift request.
Level 5 is required.

--

Parameters:

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

Example Request:

  1. {
  2. "module":"schedule.tradeswap",
  3. "method":"UPDATE",
  4. "request":{
  5. "trade":27265,
  6. "action":"accept",
  7. "user":2503236,
  8. "shift_for_swap":236523
  9. }
  10. }

Example Response:

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