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

<a id="ID4ET" />

## 備註

此 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

```

<a id="ID4EMB" />

## URI 參數

\| 參數| 類型| 描述|
\| --- | --- | --- | --- |
\| scid| GUID| 服務設定識別碼 (SCID)。工作階段識別碼的第 1 部分。|
\| sessionTemplateName| string| 工作階段範本目前執行個體的名稱。工作階段識別碼的第 2 部分。|
\| sessionName| GUID| 工作階段的唯一識別碼。工作階段識別碼的第 3 部分。|

<a id="ID4EZB" />

## HTTP 狀態碼

服務會傳回適用於 MPSD 的 HTTP 狀態碼。

<a id="ID4E6B" />

## 要求本文

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

<a id="ID4EKC" />

## 回應本文

請參閱 [MultiplayerSession (JSON)](/zh-TW/reference/live/rest/json/json-multiplayersession) 中的回應結構。

<a id="ID4ETC" />

## 另請參閱

<a id="ID4EVC" />

##### 上層

[/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName}](/zh-TW/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessionssessionname)


## Related topics

- [XblMultiplayerSessionReferenceUri](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreferenceuri.md)
- [XblMultiplayerSessionReference](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference.md)
