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

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

> Delete Activity

# Delete Activity

删除用户在特定标题中的活动。

此 API 允许游戏客户端删除用户在特定标题中的活动。当用户离开 Multiplayer Activity 时,标题应尽快删除该用户的活动。如果标题未能删除活动,用户的活动最终可能会通过在线状态检查被清理。

```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) 的字符串表示形式,客户端必须为每个请求传递此值。它用于保证活动更新的顺序。sequenceNumber 的一个很好示例是客户端的 unix 时间,因为它保证是递增的。必须大于 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) 的字符串表示形式,客户端必须为每个请求传递此值。它用于保证活动更新的顺序。sequenceNumber 的一个很好示例是客户端的 unix 时间,因为它保证是递增的。必须大于 0,且不能大于最大 ulong 值。 |

### ErrorResponse

| 名称 | 类型 | 说明 |
| - | - | - |
| debugMessage | string | 可用于调试的、人类可读的错误消息版本。 |
| errorCode | string | 错误代码枚举。 |

### ThrottledEntity

| 名称 | 类型 | 说明 |
| - | - | - |
| currentRequests | string | 当前请求数——并发或速率。 |
| debugMessage | string | 可用于调试的、人类可读的限流消息版本。 |
| limitType | string | 限制类型,即并发或速率。 |
| maxRequests | string | 允许的最大请求数——并发或速率。 |
| periodInSeconds | string | 超出速率或并发限制时适用的以秒为单位的时段。 |
| version | string | 当前限流合约版本。 |


## Related topics

- [Example code for Multiplayer Activity](https://devdocs.xbox.com/services/xbox-services/multiplayer/mpa/how-to/live-mpa-client-how-to.md)
- [Activities](https://devdocs.xbox.com/services/xbox-services/multiplayer/mpa/concepts/live-mpa-activities.md)
- [XblMultiplayerActivityDetails](https://devdocs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayeractivitydetails.md)
- [Sending reputation feedback from a title](https://devdocs.xbox.com/services/xbox-services/community/reputation/concepts/live-sending-reputation-feedback.md)
- [XblPresenceTitlePresenceChangedHandler](https://devdocs.xbox.com/reference/live/xsapi-c/presence_c/functions/xblpresencetitlepresencechangedhandler.md)
