POST /api/end
1つ以上のアクティビティをスマートフォンから消します。
終了するとカードは音を鳴らさず、すぐに消えます。最後のデザインを画面に残したい場合は、それを更新として送り、あとでアクティビティを終了します。対象の指定はupdateと同じです。
記録は残るので、restart: trueを付けた更新でカードを戻せます。無料プランの上限で終了がブロックされることはありません。
アクティビティIDで指定
1 2 3 4 5 6 7
curl -X POST https://api.webliveactivity.com/api/end \ -H 'Content-Type: application/json' \ -H 'x-api-key: wla_your_key' \ -d '{ "activityId": "act-8f2cqa4mx7rd", "widgetContainerId": "acme-orders" }'
複数のアクティビティIDで指定
1 2 3 4 5 6 7 8 9 10
curl -X POST https://api.webliveactivity.com/api/end \ -H 'Content-Type: application/json' \ -H 'x-api-key: wla_your_key' \ -d '{ "activityIds": [ "act-8f2cqa4mx7rd", "act-9k4d2bwh6tne" ], "widgetContainerId": "acme-orders" }'
グループで指定
1回の呼び出しで、グループ内のすべてのアクティビティを終了します。
1 2 3 4 5 6 7
curl -X POST https://api.webliveactivity.com/api/end \ -H 'Content-Type: application/json' \ -H 'x-api-key: wla_your_key' \ -d '{ "group": "order-tracker", "widgetContainerId": "acme-orders" }'
最終ステートを保存する
finalStateは更新と同じように保存済みのステートにマージされます。カードには表示されません。あとで再起動すると、このステートから始まります。
1 2 3 4 5 6 7 8 9 10 11 12
curl -X POST https://api.webliveactivity.com/api/end \ -H 'Content-Type: application/json' \ -H 'x-api-key: wla_your_key' \ -d '{ "activityId": "act-8f2cqa4mx7rd", "widgetContainerId": "acme-orders", "finalState": { "primaryText": "Delivered", "progress": 1, "isComplete": true } }'
レスポンス
updateと同じく{ ok, targeted, unknown }を返します。
1 2 3 4 5
{ "ok": true, "targeted": 1, "unknown": [] }









