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

# POST (/users/xuid({xuid})/devices/current/titles/current)

> POST (/users/xuid({xuid})/devices/current/titles/current)

# POST (/users/xuid({xuid})/devices/current/titles/current)

使用用户的在线状态更新标题。
这些 URI 的域为 `userpresence.xboxlive.com`。

* [备注](#ID4EV)
* [URI 参数](#ID4EEB)
* [授权](#ID4EPB)
* [必需的请求标头](#ID4ENE)
* [可选的请求标头](#ID4ERG)
* [请求正文](#ID4ERH)
* [响应正文](#ID4EKAAC)

## 备注

非主机平台上的所有标题都可以使用此 URI 来添加和更新标题的在线状态、丰富在线状态和媒体在线状态数据。

**SandboxId** 现在从 XToken 中的声明中检索并强制执行。如果 **SandboxId** 不存在,则娱乐发现服务 (EDS) 将引发 400 Bad request 错误。

## URI 参数

| 参数 | 类型 | 说明 |
| - | - | - |
| xuid | 64 位无符号整数 | 目标用户的 XBOX 用户 ID (XUID)。 |

## 授权

\| 类型 | 是否必需 | 说明 | 缺失时的响应 |
\| --- | --- | --- | --- | --- | --- | --- |
\| XUID | 是 | 调用方的 XBOX 用户 ID (XUID) | 403 Forbidden |
\| titleId | 是 | 标题的 titleId | 403 Forbidden |
\| deviceId | 除 Windows 和 Web 外均需要 | 调用方的 deviceId | 403 Forbidden |
\| deviceType | 除 Web 外均需要 | 调用方的 deviceType | 403 Forbidden |
\| sandboxId | 从中传入的调用需要 | 调用方的沙盒 | 403 Forbidden |

## 必需的请求标头

\| 标头 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Authorization | string | HTTP 身份验证的身份验证凭据。示例值:"XBL3.0 x=\<userhash>;\<token>"。 |
\| x-xbl-contract-version | string | 此请求应指向的 XBOX LIVE 服务的生成名称/编号。仅在验证标头的有效性、身份验证令牌中的声明等的有效性之后,请求才会路由到该服务。示例值:3、vnext。 |
\| Content-Type | string | 请求正文的 MIME 类型。示例值:application/json。 |
\| Content-Length | string | 请求正文的长度。示例值:312。 |
\| Host | string | 服务器的域名。示例值:presencebeta.xboxlive.com。 |

## 可选的请求标头

\| 标头 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| X-RequestedServiceVersion |  | 此请求应指向的 XBOX LIVE 服务的生成名称/编号。仅在验证标头的有效性、身份验证令牌中的声明等的有效性之后,请求才会路由到该服务。默认值:1。 |

## 请求正文

请求对象为 [TitleRequest](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-titlerequest.md)。只有正文中实际存在的属性会被更新。任何不属于正文但存在于服务器上的属性都不会被修改。

### 示例请求

```cpp theme={null}
{
  id:"12341234",
  placement:"snapped",
  state:"active"
}
      
```

## 响应正文

成功时,视情况返回 200 或 201 Created 的 HTTP 状态代码。

出错时(HTTP 4xx 或 5xx),响应正文中会返回相应的错误信息。

## 另请参阅

##### 父主题

[/users/xuid({xuid})/devices/current/titles/current](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersxuiddevicescurrenttitlescurrent.md)

##### 更多信息

[Marketplace URIs](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/marketplace/atoc-reference-marketplace.md)

[其他参考](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/atoc-xboxlivews-reference-additional.md)


## Related topics

- [/users/xuid({xuid})/devices/current/titles/current](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersxuiddevicescurrenttitlescurrent.md)
- [DELETE (/users/xuid({xuid})/devices/current/titles/current)](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersxuiddevicescurrenttitlescurrentdelete.md)
- [PresenceRecord (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-presencerecord.md)
- [TitleRecord (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-titlerecord.md)
- [TitleRequest (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-titlerequest.md)
