> ## 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](/zh-TW/reference/live/rest/json/json-presencerecord)。
這些 URI 的網域為 `userpresence.xboxlive.com`。

* [查詢字串參數](#ID4EZ)
* [授權](#ID4EIC)
* [必要的要求標頭](#ID4ELD)
* [選用的要求標頭](#ID4EPF)
* [要求本文](#ID4EPG)
* [回應本文](#ID4E1G)

<a id="ID4EZ" />

## 查詢字串參數

| 參數 | 類型 | 描述 |
| - | - | - |
| level | string | 選用。<ul><li><b>user</b>：僅傳回使用者節點。</li><li><b>device</b>：傳回使用者節點和裝置節點。</li><li><b>title</b>：預設值。傳回活動以外的整個樹狀結構。</li><li><b>all</b>：傳回整個樹狀結構，包括活動層級的目前狀態。</li></ul> |

<a id="ID4EIC" />

## 授權

\| 類型| 必要| 描述| 遺漏時的回應|
\| --- | --- | --- | --- | --- | --- | --- |
\| XUID| 是| 呼叫端的 XBOX 使用者識別碼 (XUID)| 403 Forbidden|

<a id="ID4ELD" />

## 必要的要求標頭

\| 標頭| 類型| 描述|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Authorization| string| HTTP 驗證的驗證認證。範例值："XBL3.0 x=\<userhash>;\<token>"。|
\| x-xbl-contract-version| string| 此要求應導向之 XBOX LIVE 服務的組建名稱/編號。只有在驗證標頭的有效性、驗證權杖中的宣告等之後，要求才會路由至該服務。範例值：3、vnext。|
\| Accept| string| 可接受的 Content-Type。Presence 唯一支援的是 application/json，但必須在標頭中指定。|
\| Accept-Language| string| 回應中字串可接受的地區設定。範例值：en-US。|
\| Host| string| 伺服器的網域名稱。範例值：presencebeta.xboxlive.com。|

<a id="ID4EPF" />

## 選用的要求標頭

\| 標頭| 類型| 描述|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| X-RequestedServiceVersion|  | 此要求應導向之 XBOX LIVE 服務的組建名稱/編號。只有在驗證標頭的有效性、驗證權杖中的宣告等之後，要求才會路由至該服務。預設值：1。|

<a id="ID4EPG" />

## 要求本文

此要求的本文中不會傳送任何物件。

<a id="ID4E1G" />

## 回應本文

<a id="ID4EAH" />

### 回應範例

此方法會傳回 [PresenceRecord](/zh-TW/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",
      }
    }]
  }]
}

```

<a id="ID4EQH" />

## 另請參閱

<a id="ID4ESH" />

##### 上層

[/users/me](/zh-TW/reference/live/rest/uri/presence/uri-usersme)


## Related topics

- [Request a User Store ID with X-tokens or OAuth 2.0](/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [X-token 또는 OAuth 2.0으로 User Store ID 요청](/ko/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [使用 X-token 或 OAuth 2.0 要求 User Store ID](/zh-TW/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [使用 X-token 或 OAuth 2.0 请求 User Store ID](/zh-CN/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [Solicitud de un User Store ID con tokens X u OAuth 2.0](/es/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
