> ## 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.

# GET /titles/{titleId}/users/{xuid}/activities API

> Get Activity

# Get Activity

获取用户在特定标题中的活动。此 API 允许游戏客户端或服务器获取用户在特定标题中的活动。

```http theme={null}
GET /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 |

## 响应

| 名称 | 类型 | 说明 |
| - | - | - |
| 200 OK | GetActivityResponse | 返回一个包含指定用户活动的对象。 |
| 204 No Content | | 请求成功,但未找到可返回的活动。 |
| 400 Bad Request | [ErrorResponse](#errorresponse) | 处理请求时发生错误。可能的错误代码:“RequestValidationError: The request validation has failed.”、“AuthorizationError: The caller is not allowed to access the resource. Too many requests.” |
| 其他状态代码 | [ThrottledEntity](#throttledentity) | 请求过多。标头 Retry-After: integer |

## 定义

* [ErrorResponse](#errorresponse)
* [GetActivityResponse](#getactivityresponse)
* [JoinRestriction](#joinrestriction)
* [Platform](#platform)
* [ThrottledEntity](#throttledentity)

### ErrorResponse

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

### GetActivityResponse

| 名称 | 类型 | 说明 |
| - | - | - |
| connectionString | string | 连接字符串是传递给正在连接的客户端以加入游戏的对象。连接字符串通常包含服务器 IP 之类的信息,以使加入的用户能够进行连接。连接字符串的长度限制为 512 个字符。 |
| currentPlayers | integer | 已经与该用户一起在多玩家活动中游戏的玩家数。 |
| groupId | string | 用于将作为同一场游戏一部分进行游戏的所有用户分组的唯一标识符。 |
| joinRestriction | [JoinRestriction](#joinrestriction) | 用于设置谁可以加入当前玩家的选项。 |
| maxPlayers | integer | 当前活动中可以与此玩家一起游戏的最大玩家数。 |
| platform | [Platform](#platform) | |
| sequenceNumber | string | 这是单调递增数字 (ulong) 的字符串表示形式,客户端必须为每个请求传递此值。它用于保证活动更新的顺序。sequenceNumber 的一个很好示例是客户端的 unix 时间,因为它保证是递增的。必须大于 0,且不能大于最大 ulong 值。 |
| titleId | integer | 请求活动的游戏的 titleId。 |

### JoinRestriction

| 名称 | 类型 | 说明 |
| - | - | - |
| Followed | string | |
| InviteOnly | string | |
| Public | string | |

### Platform

| 名称 | 类型 | 说明 |
| - | - | - |
| Android | string | |
| IOS | string | |
| Nintendo | string | |
| PlayStation | string | |

### ThrottledEntity

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


## Related topics

- [DELETE /titles/{titleId}/users/{xuid}/activities](https://docs.xbox.com/zh-CN/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-DeleteActivity.md)
- [PUT /titles/{titleId}/users/{xuid}/activities](https://docs.xbox.com/zh-CN/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-UpdateActivity.md)
- [POST /titles/{titleId}/activities/query](https://docs.xbox.com/zh-CN/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-ExternalGetActivityBatch.md)
- [POST /titles/{titleId}/invites/server API](https://docs.xbox.com/zh-CN/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-SendServerInvite.md)
- [GET (/users/xuid({xuid})/history/titles)](https://docs.xbox.com/zh-CN/reference/live/rest/uri/titlehistory/uri-titlehistoryusersxuidhistorytitlesgetv2.md)
