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

# GET (/users/me)

> GET (/users/me)

# GET (/users/me)

无需知道用户的 XUID 即可获取当前用户的 [PresenceRecord](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-presencerecord)。
这些 URI 的域为 `userpresence.xboxlive.com`。

* [查询字符串参数](#ID4EZ)
* [授权](#ID4EIC)
* [必需的请求标头](#ID4ELD)
* [可选的请求标头](#ID4EPF)
* [请求正文](#ID4EPG)
* [响应正文](#ID4E1G)

## 查询字符串参数

| 参数 | 类型 | 说明 |
| - | - | - |
| level | string | 可选。<ul><li>**user**:仅返回用户节点。</li><li>**device**:返回用户节点和设备节点。</li><li>**title**:默认。返回除活动外的整个树。</li><li>**all**:返回整个树,包括活动级在线状态。</li></ul> |

## 授权

\| 类型 | 是否必需 | 说明 | 缺失时的响应 |
\| --- | --- | --- | --- | --- | --- | --- |
\| XUID | 是 | 调用方的 XBOX 用户 ID (XUID) | 403 Forbidden |

## 必需的请求标头

\| 标头 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Authorization | string | HTTP 身份验证的身份验证凭据。示例值:"XBL3.0 x=\<userhash>;\<token>"。 |
\| x-xbl-contract-version | string | 此请求应指向的 XBOX LIVE 服务的生成名称/编号。仅在验证标头的有效性、身份验证令牌中的声明等的有效性之后,请求才会路由到该服务。示例值:3、vnext。 |
\| Accept | string | 可接受的 Content-Type。在线状态服务仅支持 application/json,但必须在标头中指定。 |
\| Accept-Language | string | 响应中字符串的可接受区域设置。示例值:en-US。 |
\| Host | string | 服务器的域名。示例值:presencebeta.xboxlive.com。 |

## 可选的请求标头

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

## 请求正文

此请求正文中未发送任何对象。

## 响应正文

### 示例响应

此方法返回 [PresenceRecord](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-presencerecord)。

```cpp theme={null}
{
  xuid:"0123456789",
  state:"online",
  devices:
  [{
    type:"D",
    titles:
    [{
      id:"12341234",
      name:"Contoso 5",
      state:"active",
      placement:"fill",
      timestamp:"2012-09-17T07:15:23.4930000",
      activity:
      {
        richPresence:"Team Deathmatch on Nirvana"
      }
    },
    {
      id:"12341235",
      name:"Contoso Waypoint",
      timestamp:"2012-09-17T07:15:23.4930000",
      placement:"snapped",
      state:"active",
      activity:
      {
        richPresence:"Using radar"
      }
    }]
  },
  {
    type:W8,
    titles:
    [{
      id:"23452345",
      name:"Contoso Gamehelp",
      state:"active",
      placement:"full",
      timestamp:"2012-09-17T07:15:23.4930000",
      activity:
      {
        richPresence:"Nirvana page",
      }
    }]
  }]
}

```

## 另请参阅

##### 父主题

[/users/me](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersme)


## Related topics

- [Requesting a User Store ID from your service with X-tokens or OAuth 2.0](https://devdocs.xbox.com/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [Solicitud de un User Store ID desde su servicio con tokens X u OAuth 2.0](https://devdocs.xbox.com/es/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [使用 X-token 或 OAuth 2.0 从服务中请求 User Store ID](https://devdocs.xbox.com/zh-CN/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [使用 X-token 或 OAuth 2.0 從您的服務要求 User Store ID](https://devdocs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [Demander un User Store ID depuis votre service avec des X-tokens ou OAuth 2.0](https://devdocs.xbox.com/fr/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
