cms 人工處理例外流程(單筆)api.md
21 additions, 387 deletions
| ... | ... | @@ -2,419 +2,53 @@ |
| 2 | - | 1.0 | 初版 | 2026/01/27 | Hanna | | |
| 2 | + | 1.0 | 初版 | 2026/03/20 | Hanna | | |
| 3 | - * 服務名稱:查詢任務詳情 API。 | |
| 3 | + * 服務名稱:**cms 人工處理例外流程(單筆)**。 | |
| 4 | - * 邏輯說明: | |
| 4 | + * 邏輯說明:處理cms人工單筆例外流程 | |
| 5 | - curl GET {BaseURL} /mds/mbps/mission/detail?id=123 | |
| 5 | + curl GET {BaseURL} /res/rule/remedial | |
| 6 | - ### REQUEST HEADER | |
| 6 | + ## REQUEST PARAMETER/BODY | |
| 7 | - | 1 | X-Auth-Token | String | true | session token | ex. Gy6u-SIDe7N3zCrPqaG0YcJ+.a5b00e2c-3334-3acd-9c37 | | |
| 7 | + | 1 | userId | String | true | 使用者id | FOOBAR123 | | |
| 8 | +| 1 | masterId | String | true | 母任務 ID | SUB001 | | |
| 9 | +| 1 | subId | String | true | 子任務 ID | | | |
| 10 | +| 1 | count | String | true | 記分 (可為負數) | | | |
| 11 | +| 1 | source | String | true | 計分來源 | CMS/system/error | | |
| 8 | - ## URL PARAMETER | |
| 12 | + request body | |
| 9 | -| Level | Key | Data type | Required | Field name | Description / Example | | |
| 10 | -| ---| ---| ---| ---| ---| --- | | |
| 11 | - | 1 | id | String | true | 任務 ID | 123 | | |
| 13 | + ```json | |
| 14 | +{ | |
| 15 | + "userId": "FOOBAR123", | |
| 16 | + "masterId":"1", | |
| 17 | + "subId":"1", | |
| 18 | + "count":"-1", | |
| 19 | + "source":"CMS" | |
| 20 | +} | |
| 21 | +``` | |
| 12 | - | 1 | success | Boolean | true | 是否成功 | | | |
| 22 | + | 1 | success | Boolean | true | 是否執行成功 | | | |
| 13 | -| 2 | id | String | true | 任務 ID | 123 | | |
| 14 | -| 2 | name | String | true | 任務名稱 | 1212限定I甜蜜共享 | | |
| 15 | -| 2 | description | String | true | 任務詳情 | 至花點專區,兌換並核銷指定星巴克票券2張,即可獲得小樹點(生活)30點。 | | |
| 16 | -| 2 | category | String | true | 任務類型 | `ASSIGNED` : 指定型`MILESTONE` : 多門檻型`SEQUENTIAL` : 關聯型 | | |
| 17 | -| 2 | status | String | true | 任務狀態 | `UNSTARTED : 尚未開始`<br>`STARTED : 已開始未達標`<br>`UNCLAIMED : 已達標未領獎`<br>`CLAIMED : 已領獎`<br>`FULL : 已額滿`<br>`OVERDUE : 已逾期` | | |
| 18 | -| 2 | progress | String | true | 任務完成進度 | "0.65" | | |
| 19 | -| 2 | remainingTime | Integer | true | 任務剩餘時間(秒) | 259200 | | |
| 20 | -| 2 | remainingQuota | Integer | true | 任務剩餘名額 | 1000 | | |
| 21 | -| 2 | quota | Integer | true | 任務限制名額 | 1000 | | |
| 22 | -| 2 | startDate | String | true | 任務開始時間 | ISO8601 格式2026-01-01T00:00:00+08:00 | | |
| 23 | -| 2 | endDate | String | true | 任務截止時間 | ISO8601 格式<br>2026-12-31T23:59:59+08:00 | | |
| 24 | -| 2 | awardType | String | true | 獎項類型 | `POINT` : 小樹點<br>`VOUCHER` : 票券 | | |
| 25 | -| 2 | awardContent | String | true | 獎項內容 | 星巴克拿鐵票券乙張<br>30 | | |
| 26 | -| 2 | terms | String | true | 任務活動條款 | <ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入點,查看入點狀況請至「首頁小樹點牌卡」</li></ol> | | |
| 27 | -| 2 | shareable | Boolean | true | 該任務是否可分享 | true | | |
| 28 | -| 2 | subtasks | Array<Subtask> | true | 子任務列表 | 請參考下方 **Subtask** 區塊 | | |
| 29 | - | |
| 30 | -## Subtask | |
| 31 | - | |
| 32 | -| Level | Parameters | Data type | Required field | Field name | Description / example | | |
| 33 | -| ---| ---| ---| ---| ---| --- | | |
| 34 | -| 3 | id | String | true | 子任務 ID | 123 | | |
| 35 | -| 3 | name | String | true | 子任務名稱 | 兌換星巴克美式票券2張 | | |
| 36 | -| 3 | targetCount | Integer | true | 總目標數 | 5 | | |
| 37 | -| 3 | completedCount | Integer | true | 已完成目標數 | 1 | | |
| 38 | -| 3 | isCTAVisible | Boolean | true | 是否顯示 CTA | true | | |
| 39 | -| 3 | ctaContent | String | true | CTA 文案(按鈕文案) | 立即前往 | | |
| 40 | -| 3 | ctaLink | String | true | CTA 連結 | mmo://CouponList?tab=exchange&voucherType=C&storeName=肯德基 | | |
| 41 | -| 3 | awardType | String | false | 子任務獎項類型 | 除指定型任務以外會回傳<br>`POINT` : 小樹點<br>`VOUCHER` : 票券 | | |
| 42 | -| 3 | awardContent | String | false | 子任務獎項內容 | 除指定型任務以外會回傳<br>星巴克拿鐵票券乙張<br>30 | | |
| 43 | -| 3 | awardClaimed | Boolean | false | 子任務是否已領獎 | false | | |
| 44 | - | |
| 45 | -FULL | |
| 46 | -## RESPONSE BODY - json format | |
| 47 | - | |
| 48 | -* 任務明細(尚未開始) | |
| 49 | - | |
| 50 | - ```json | |
| 51 | - { | |
| 52 | - "success": true, | |
| 53 | - "errorCode": null, | |
| 54 | - "message": null, | |
| 55 | - "values": { | |
| 56 | - "id": "FOOBAR123", | |
| 57 | - "name": "1212限定I成雙成對甜蜜共享", | |
| 58 | - "description": "兌換專區內指定任兩張票券,即可獲得小樹點(生活) 30 點", | |
| 59 | - "category": "ASSIGNED", | |
| 60 | - "status": "UNSTARTED", | |
| 61 | - "progress": "0.00", | |
| 62 | - "remainingTime": 2592000, | |
| 63 | - "remainingQuota": 1000, | |
| 64 | - "quota": 1000, | |
| 65 | - "startDate": "2026-08-01T00:00:00+08:00", | |
| 66 | - "endDate": "2026-12-31T23:59:59+08:00", | |
| 67 | - "awardType": "POINT", | |
| 68 | - "awardContent": "30", | |
| 69 | - "terms": "<ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入點,查看入點狀況請至「首頁小樹點牌卡」</li></ol>", | |
| 70 | - "shareable": true, | |
| 71 | - "subtasks": [ | |
| 72 | - { | |
| 73 | - "id": "SUB001", | |
| 74 | - "name": "兌換星巴克票券1張", | |
| 75 | - "targetCount": 1, | |
| 76 | - "completedCount": 0, | |
| 77 | - "isCTAVisible": true, | |
| 78 | - "ctaContent": "前往兌換", | |
| 79 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=Starbucks", | |
| 80 | - "awardType": null, | |
| 81 | - "awardContent": null, | |
| 82 | - "awardClaimed": null | |
| 83 | - }, | |
| 84 | - { | |
| 85 | - "id": "SUB002", | |
| 86 | - "name": "兌換 KFC 票券1張", | |
| 87 | - "targetCount": 1, | |
| 88 | - "completedCount": 0, | |
| 89 | - "isCTAVisible": true, | |
| 90 | - "ctaContent": "前往兌換", | |
| 91 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=KFC", | |
| 92 | - "awardType": null, | |
| 93 | - "awardContent": null, | |
| 94 | - "awardClaimed": null | |
| 95 | - } | |
| 96 | - ] | |
| 97 | - } | |
| 98 | - } | |
| 99 | - ``` | |
| 100 | - | |
| 101 | - | |
| 102 | -* 任務明細(已開始,尚未達標) | |
| 103 | - | |
| 104 | - ```json | |
| 105 | - { | |
| 106 | - "success": true, | |
| 107 | - "errorCode": null, | |
| 108 | - "message": null, | |
| 109 | - "values": { | |
| 110 | - "id": "FOOBAR123", | |
| 111 | - "name": "1212限定I成雙成對甜蜜共享", | |
| 112 | - "description": "兌換專區內指定任兩張票券,即可獲得星巴克拿鐵票券乙張", | |
| 113 | - "category": "ASSIGNED", | |
| 114 | - "status": "STARTED", | |
| 115 | - "progress": "0.50", | |
| 116 | - "remainingTime": 2592000, | |
| 117 | - "remainingQuota": 88, | |
| 118 | - "quota": 1000, | |
| 119 | - "startDate": "2026-01-01T00:00:00+08:00", | |
| 120 | - "endDate": "2026-10-31T23:59:59+08:00", | |
| 121 | - "awardType": "VOUCHER", | |
| 122 | - "awardContent": "星巴克拿鐵票券乙張", | |
| 123 | - "terms": "<ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入券,查看入券狀況請至「我的票券」</li></ol>", | |
| 124 | - "shareable": true, | |
| 125 | - "subtasks": [ | |
| 126 | - { | |
| 127 | - "id": "SUB001", | |
| 128 | - "name": "兌換星巴克票券1張", | |
| 129 | - "targetCount": 1, | |
| 130 | - "completedCount": 0, | |
| 131 | - "isCTAVisible": true, | |
| 132 | - "ctaContent": "前往兌換", | |
| 133 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=Starbucks", | |
| 134 | - "awardType": null, | |
| 135 | - "awardContent": null, | |
| 136 | - "awardClaimed": null | |
| 137 | - }, | |
| 138 | - { | |
| 139 | - "id": "SUB002", | |
| 140 | - "name": "兌換 KFC 票券1張", | |
| 141 | - "targetCount": 1, | |
| 142 | - "completedCount": 1, | |
| 143 | - "isCTAVisible": true, | |
| 144 | - "ctaContent": "前往兌換", | |
| 145 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=KFC", | |
| 146 | - "awardType": null, | |
| 147 | - "awardContent": null, | |
| 148 | - "awardClaimed": null | |
| 149 | - } | |
| 150 | - ] | |
| 151 | - } | |
| 152 | - } | |
| 153 | - ``` | |
| 154 | - | |
| 155 | - | |
| 156 | -* 任務明細(已達標,尚未領獎) | |
| 157 | - | |
| 158 | - ```json | |
| 159 | - { | |
| 160 | - "success": true, | |
| 161 | - "errorCode": null, | |
| 162 | - "message": null, | |
| 163 | - "values": { | |
| 164 | - "id": "FOOBAR123", | |
| 165 | - "name": "1212限定I成雙成對甜蜜共享", | |
| 166 | - "description": "兌換專區內指定任兩張票券,即可獲得星巴克拿鐵票券乙張", | |
| 167 | - "category": "ASSIGNED", | |
| 168 | - "status": "UNCLAIMED", | |
| 169 | - "progress": "1.00", | |
| 170 | - "remainingTime": 2592000, | |
| 171 | - "remainingQuota": 88, | |
| 172 | - "quota": 1000, | |
| 173 | - "startDate": "2026-01-01T00:00:00+08:00", | |
| 174 | - "endDate": "2026-10-31T23:59:59+08:00", | |
| 175 | - "awardType": "VOUCHER", | |
| 176 | - "awardContent": "星巴克拿鐵票券乙張", | |
| 177 | - "terms": "<ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入券,查看入券狀況請至「我的票券」</li></ol>", | |
| 178 | - "shareable": true, | |
| 179 | - "subtasks": [ | |
| 180 | - { | |
| 181 | - "id": "SUB001", | |
| 182 | - "name": "兌換星巴克票券1張", | |
| 183 | - "targetCount": 1, | |
| 184 | - "completedCount": 1, | |
| 185 | - "isCTAVisible": true, | |
| 186 | - "ctaContent": "前往兌換", | |
| 187 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=Starbucks", | |
| 188 | - "awardType": null, | |
| 189 | - "awardContent": null, | |
| 190 | - "awardClaimed": null | |
| 191 | - }, | |
| 192 | - { | |
| 193 | - "id": "SUB002", | |
| 194 | - "name": "兌換 KFC 票券1張", | |
| 195 | - "targetCount": 1, | |
| 196 | - "completedCount": 1, | |
| 197 | - "isCTAVisible": true, | |
| 198 | - "ctaContent": "前往兌換", | |
| 199 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=KFC", | |
| 200 | - "awardType": null, | |
| 201 | - "awardContent": null, | |
| 202 | - "awardClaimed": null | |
| 203 | - } | |
| 204 | - ] | |
| 205 | - } | |
| 206 | - } | |
| 207 | - ``` | |
| 208 | - | |
| 209 | - | |
| 210 | -* 任務明細(已領獎) | |
| 211 | - | |
| 212 | - ```json | |
| 213 | - { | |
| 214 | - "success": true, | |
| 215 | - "errorCode": null, | |
| 216 | - "message": null, | |
| 217 | - "values": { | |
| 218 | - "id": "FOOBAR123", | |
| 219 | - "name": "1212限定I成雙成對甜蜜共享", | |
| 220 | - "description": "兌換專區內指定任兩張票券,即可獲得星巴克拿鐵票券乙張", | |
| 221 | - "category": "ASSIGNED", | |
| 222 | - "status": "CLAIMED", | |
| 223 | - "progress": "1.00", | |
| 224 | - "remainingTime": 2592000, | |
| 225 | - "remainingQuota": 88, | |
| 226 | - "quota": 1000, | |
| 227 | - "startDate": "2026-01-01T00:00:00+08:00", | |
| 228 | - "endDate": "2026-10-31T23:59:59+08:00", | |
| 229 | - "awardType": "VOUCHER", | |
| 230 | - "awardContent": "星巴克拿鐵票券乙張", | |
| 231 | - "terms": "<ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入券,查看入券狀況請至「我的票券」</li></ol>", | |
| 232 | - "shareable": true, | |
| 233 | - "subtasks": [ | |
| 234 | - { | |
| 235 | - "id": "SUB001", | |
| 236 | - "name": "兌換星巴克票券1張", | |
| 237 | - "targetCount": 1, | |
| 238 | - "completedCount": 1, | |
| 239 | - "isCTAVisible": true, | |
| 240 | - "ctaContent": "前往兌換", | |
| 241 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=Starbucks", | |
| 242 | - "awardType": null, | |
| 243 | - "awardContent": null, | |
| 244 | - "awardClaimed": null | |
| 245 | - }, | |
| 246 | - { | |
| 247 | - "id": "SUB002", | |
| 248 | - "name": "兌換 KFC 票券1張", | |
| 249 | - "targetCount": 1, | |
| 250 | - "completedCount": 1, | |
| 251 | - "isCTAVisible": true, | |
| 252 | - "ctaContent": "前往兌換", | |
| 253 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=KFC", | |
| 254 | - "awardType": null, | |
| 255 | - "awardContent": null, | |
| 256 | - "awardClaimed": null | |
| 257 | - } | |
| 258 | - ] | |
| 259 | - } | |
| 260 | - } | |
| 261 | - ``` | |
| 262 | - | |
| 263 | - | |
| 264 | -* 任務明細(已額滿) | |
| 265 | - | |
| 266 | - ```json | |
| 267 | - { | |
| 268 | - "success": true, | |
| 269 | - "errorCode": null, | |
| 270 | - "message": null, | |
| 271 | - "values": { | |
| 272 | - "id": "FOOBAR123", | |
| 273 | - "name": "1212限定I成雙成對甜蜜共享", | |
| 274 | - "description": "兌換專區內指定任兩張票券,即可獲得星巴克拿鐵票券乙張", | |
| 275 | - "category": "ASSIGNED", | |
| 276 | - "status": "FULL", | |
| 277 | - "progress": "1.00", | |
| 278 | - "remainingTime": 2592000, | |
| 279 | - "remainingQuota": 0, | |
| 280 | - "quota": 1000, | |
| 281 | - "startDate": "2026-01-01T00:00:00+08:00", | |
| 282 | - "endDate": "2026-10-31T23:59:59+08:00", | |
| 283 | - "awardType": "VOUCHER", | |
| 284 | - "awardContent": "星巴克拿鐵票券乙張", | |
| 285 | - "terms": "<ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入券,查看入券狀況請至「我的票券」</li></ol>", | |
| 286 | - "shareable": true, | |
| 287 | - "subtasks": [ | |
| 288 | - { | |
| 289 | - "id": "SUB001", | |
| 290 | - "name": "兌換星巴克票券1張", | |
| 291 | - "targetCount": 1, | |
| 292 | - "completedCount": 1, | |
| 293 | - "isCTAVisible": true, | |
| 294 | - "ctaContent": "前往兌換", | |
| 295 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=Starbucks", | |
| 296 | - "awardType": null, | |
| 297 | - "awardContent": null, | |
| 298 | - "awardClaimed": null | |
| 299 | - }, | |
| 300 | - { | |
| 301 | - "id": "SUB002", | |
| 302 | - "name": "兌換 KFC 票券1張", | |
| 303 | - "targetCount": 1, | |
| 304 | - "completedCount": 1, | |
| 305 | - "isCTAVisible": true, | |
| 306 | - "ctaContent": "前往兌換", | |
| 307 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=KFC", | |
| 308 | - "awardType": null, | |
| 309 | - "awardContent": null, | |
| 310 | - "awardClaimed": null | |
| 311 | - } | |
| 312 | - ] | |
| 313 | - } | |
| 314 | - } | |
| 315 | - ``` | |
| 316 | - | |
| 317 | - | |
| 318 | -* 任務明細(已逾期) | |
| 319 | - | |
| 320 | - ```json | |
| 321 | - { | |
| 322 | - "success": true, | |
| 323 | - "errorCode": null, | |
| 324 | - "message": null, | |
| 325 | - "values": { | |
| 326 | - "id": "FOOBAR123", | |
| 327 | - "name": "1212限定I成雙成對甜蜜共享", | |
| 328 | - "description": "兌換專區內指定任兩張票券,即可獲得星巴克拿鐵票券乙張", | |
| 329 | - "category": "ASSIGNED", | |
| 330 | - "status": "OVERDUE", | |
| 331 | - "progress": "0.50", | |
| 332 | - "remainingTime": 0, | |
| 333 | - "remainingQuota": 100, | |
| 334 | - "quota": 1000, | |
| 335 | - "startDate": "2026-01-01T00:00:00+08:00", | |
| 336 | - "endDate": "2026-01-31T23:59:59+08:00", | |
| 337 | - "awardType": "VOUCHER", | |
| 338 | - "awardContent": "星巴克拿鐵票券乙張", | |
| 339 | - "terms": "<ol><li>各項任務採限額限量制,每人限得獎乙次,不可重複獲獎</li><li>得獎者將於收到系統通知後入券,查看入券狀況請至「我的票券」</li></ol>", | |
| 340 | - "shareable": true, | |
| 341 | - "subtasks": [ | |
| 342 | - { | |
| 343 | - "id": "SUB001", | |
| 344 | - "name": "兌換星巴克票券1張", | |
| 345 | - "targetCount": 1, | |
| 346 | - "completedCount": 0, | |
| 347 | - "isCTAVisible": true, | |
| 348 | - "ctaContent": "前往兌換", | |
| 349 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=Starbucks", | |
| 350 | - "awardType": null, | |
| 351 | - "awardContent": null, | |
| 352 | - "awardClaimed": null | |
| 353 | - }, | |
| 354 | - { | |
| 355 | - "id": "SUB002", | |
| 356 | - "name": "兌換 KFC 票券1張", | |
| 357 | - "targetCount": 1, | |
| 358 | - "completedCount": 1, | |
| 359 | - "isCTAVisible": true, | |
| 360 | - "ctaContent": "前往兌換", | |
| 361 | - "ctaLink": "mmo://BrandProducts?productType=eCoupon&brandCode=KFC", | |
| 362 | - "awardType": null, | |
| 363 | - "awardContent": null, | |
| 364 | - "awardClaimed": null | |
| 365 | - } | |
| 366 | - ] | |
| 367 | - } | |
| 368 | - } | |
| 369 | - ``` | |
| 370 | - | |
| 371 | - | |
| 372 | -* API 錯誤 | |
| 373 | - | |
| 374 | - ```cs | |
| 375 | - { | |
| 376 | - "success": false, | |
| 377 | - "errorCode": {error_code}, | |
| 378 | - "message": {error_message}, | |
| 379 | - "values": null | |
| 380 | - } | |
| 381 | - ``` | |
| 382 | - | |
| 383 | - | |
| 384 | -| B2E內部錯誤訊息 | B2E錯誤代碼 | App錯誤訊息 | App錯誤代碼 | | |
| 385 | -| ---| ---| ---| --- | | |
| 386 | -| remote config 已關閉任務牆功能<br> | MBPS_MISSION_REMOTE_CONFIG_ENABLED<br> | 系統維護中,請稍後再試<br> | MBPS0021<br> | | |
| 387 | -| 已下架/超過下架時間/未到上架時間/沒有該任務ID<br> | MBPS_MISSION_NOT_FOUND<br> | 目前無法查看此任務<br> | MBPS0019<br> | | |
| 388 | -| 使用者不在測試名單中<br> | MBPS_USER_NOT_IN_BETA<br> | 系統維護中,請稍後再試 | MBPS0020<br> | |