> ## 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 (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName})

> GET (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName})

# GET (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName})

获取会话对象。

> **重要：**\
> 此 URI 方法要求每个请求都包含一个 X-Xbl-Contract-Version: 104/105 或更高版本的头元素。

* [备注](#ID4ET)
* [URI 参数](#ID4EMB)
* [HTTP 状态代码](#ID4EZB)
* [请求正文](#ID4E6B)
* [响应正文](#ID4EKC)

## 备注

此 HTTP/REST 方法读取指定名称的会话文档并检索会话。成功后，它将返回从服务器获取的会话对象及其所有属性。此方法可以由 **Microsoft.Xbox.Services.Multiplayer.MultiplayerService.GetCurrentSessionAsync** 包装。GET 方法的参数直接与会话的 **MultiplayerSessionReference** 对象中指定的参数对应，该对象在 **GetCurrentSessionAsync** 的 *sessionReference* 参数中传递。

GET 方法的线路格式如下所示。

```cpp theme={null}
GET /serviceconfigs/00000000-0000-0000-0000-000000000000/sessiontemplates/quick/sessions/00000000-0000-0000-0000-000000000001 HTTP/1.1
      Content-Type: application/json

```

## URI 参数

\| 参数| 类型| 说明|
\| --- | --- | --- | --- |
\| scid| GUID| 服务配置标识符 (SCID)。会话标识符的第 1 部分。|
\| sessionTemplateName| string| 会话模板当前实例的名称。会话标识符的第 2 部分。|
\| sessionName| GUID| 会话的唯一 ID。会话标识符的第 3 部分。|

## HTTP 状态代码

服务返回适用于 MPSD 的 HTTP 状态代码。

## 请求正文

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

## 响应正文

请参阅 [MultiplayerSession (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-multiplayersession) 中的响应结构。

## 另请参阅

##### 上级

[/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName}](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessionssessionname)


## Related topics

- [XblMultiplayerSessionReferenceUri](https://devdocs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreferenceuri.md)
- [XblMultiplayerSessionReference](https://devdocs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference.md)
