> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DELETE /titles/{titleId}/users/{xuid}/activities

> 刪除活動

# 刪除活動

刪除正在玩特定遊戲之使用者的活動。

此 API 可讓遊戲用戶端刪除正在玩特定遊戲之使用者的活動。使用者離開多人遊戲活動後，遊戲應立即刪除該使用者的活動。如果遊戲未能刪除活動，使用者的活動最終可能會由狀態檢查清除。

```http theme={null}
DELETE /titles/{titleId}/users/{xuid}/activities
```

## URI 參數

| 參數 | 位置 | 必要 | 類型 | 描述 |
| - | - | - | - | - |
| titleId | path | TRUE | integer | 傳送要求的目標遊戲 titleId。 |
| xuid | path | TRUE | string | 目前要求中所參考使用者的 XUID。XUID 以十進位整數表示。 |

## 要求標頭

| 名稱 | 必要 | 類型 | 描述 |
| - | - | - | - |
| Authorization | TRUE | integer | 呼叫者必須以 XBL 3.0 授權格式提供 XToken。例如，Authorization: XBL3.0 x=2553948354698;>encrypted token\<) |
| Content-Type | TRUE | string | ContentType 必須設定為 application/json |

## 要求本文

| 名稱 | 必要 | 類型 | 描述 |
| - | - | - | - |
| sequenceNumber | TRUE | string | 這是單調遞增數字 (ulong) 的字串表示法，用戶端必須在每個要求中傳入。它用於保證活動更新的順序。用戶端的 Unix 時間是 sequenceNumber 的一個好例子，因為它保證會遞增。必須大於 0，且不能大於 ulong 的最大值。 |

## 回應

| 名稱 | 類型 | 描述 |
| - | - | - |
| 204 No Content | | 已刪除項目。 |
| 400 Bad Request | [ErrorResponse](#errorresponse) | 處理要求時發生錯誤。可能的錯誤碼："RequestValidationError: The request validation has failed.", " AuthorizationError: The caller is not allowed to access the resource." |
| 其他狀態碼 | [ThrottledEntity](#throttledentity) | 要求過多。標頭 Retry-After: integer |

## 定義

* [DeleteActivityRequest](#deleteactivityrequest)
* [ErrorResponse](#errorresponse)
* [ThrottledEntity](#throttledentity)

### DeleteActivityRequest

| 名稱 | 類型 | 描述 |
| - | - | - |
| sequenceNumber | string | 這是單調遞增數字 (ulong) 的字串表示法，用戶端必須在每個要求中傳入。它用於保證活動更新的順序。用戶端的 Unix 時間是 sequenceNumber 的一個好例子，因為它保證會遞增。必須大於 0，且不能大於 ulong 的最大值。 |

### ErrorResponse

| 名稱 | 類型 | 描述 |
| - | - | - |
| debugMessage | string | 可用於偵錯的人類可讀錯誤訊息版本。 |
| errorCode | string | 錯誤碼列舉。 |

### ThrottledEntity

| 名稱 | 類型 | 描述 |
| - | - | - |
| currentRequests | string | 目前的要求數 - 並行或速率。 |
| debugMessage | string | 可用於偵錯的人類可讀節流訊息版本。 |
| limitType | string | 限制類型，即並行或速率。 |
| maxRequests | string | 允許的最大要求數 - 並行或速率。 |
| periodInSeconds | string | 超過速率或並行限制時套用的期間 (以秒為單位)。 |
| version | string | 目前的節流合約版本。 |


## Related topics

- [PUT /titles/{titleId}/users/{xuid}/activities](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-UpdateActivity.md)
- [GET /titles/{titleId}/users/{xuid}/activities API](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-GetActivity.md)
- [DELETE (/users/xuid({xuid})/devices/current/titles/current)](https://docs.xbox.com/zh-TW/reference/live/rest/uri/presence/uri-usersxuiddevicescurrenttitlescurrentdelete.md)
- [POST /titles/{titleId}/activities/query](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-ExternalGetActivityBatch.md)
- [POST /titles/{titleId}/invites](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-SendInvite.md)
