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

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

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

セッション テンプレート ドキュメントを取得します。

> **重要:**\
> この URI メソッドでは、すべてのリクエストにヘッダー要素 X-Xbl-Contract-Version: 104/105 以降が必要です。

* [解説](#ID4ET)
* [URI パラメーター](#ID4EKB)
* [HTTP ステータス コード](#ID4EXB)
* [リクエスト本文](#ID4EAC)
* [レスポンス本文](#ID4EKC)

## 解説

この HTTP/REST メソッドは、指定されたフィルターに対するセッション テンプレート情報を取得します。このメソッドは **Microsoft.Xbox.Services.Multiplayer.MultiplayerService.GetSessionsAsync** によってラップできます。

> **注意:**\
> 2015 Multiplayer では、このメソッドは **Microsoft.Xbox.Services.Multiplayer.MultiplayerService.GetSessionsForUsersFilterAsync** によって呼び出されます。

> **注意:**\
> このメソッドの各呼び出しには、キーワード、XBOX ユーザー ID フィルター、またはその両方を含める必要があります。呼び出し元が *private* および *reservations* パラメーターに対する適切な権限を持っていない場合、該当するセッションが実際に存在するかどうかにかかわらず、このメソッドはエラー コード 403 Forbidden を返します。

## URI パラメーター

\| パラメーター | 型 | 説明 |
\| --- | --- | --- | --- | --- | --- |
\| scid| GUID| サービス構成識別子 (SCID)。セッション ID のパート 1。|
\| keyword| string| 結果を、その文字列で識別されるセッションのみにフィルタリングするために使用されるキーワード。|
\| xuid| GUID| セッションを取得する対象のユーザーの XBOX ユーザー ID。ユーザーはセッションでアクティブである必要があります。 |
\| reservations| string| セッションの一覧に、ユーザーが承諾していないセッションを含めるかどうかを示す値。このパラメーターは true にのみ設定できます。この設定には、呼び出し元がセッションに対するサーバー レベル アクセス権を持っているか、呼び出し元の XUID クレームが XBOX ユーザー ID フィルターと一致することが必要です。 |
\| inactive| string| セッションの一覧に、ユーザーが承諾しているがアクティブにプレイしていないセッションを含めるかどうかを示す値。このパラメーターは true にのみ設定できます。 |
\| private| string| セッションの一覧にプライベート セッションを含めるかどうかを示す値。このパラメーターは true にのみ設定できます。自分自身のセッションを問い合わせる場合、またはサーバー間で問い合わせる場合にのみ有効です。このパラメーターを true に設定するには、呼び出し元がセッションに対するサーバー レベル アクセス権を持っているか、呼び出し元の XUID クレームが XBOX ユーザー ID フィルターと一致することが必要です。 |
\| visibility| string| 結果のフィルタリングに使用される可視性の状態を示す列挙値。現在、このパラメーターはオープン セッションを含めるための Open にのみ設定できます。**MultiplayerSessionVisibility** を参照してください。 |
\| version| string| 含めるセッションのメジャー セッション バージョン以下を示す正の整数。値はリクエストのコントラクト バージョンを 100 で割った剰余以下である必要があります。 |
\| take| string| 取得するセッションの最大数を示す正の整数。|

## HTTP ステータス コード

サービスは、MPSD に適用される HTTP ステータス コードを返します。

## リクエスト本文

このリクエストの本文にはオブジェクトを送信しません。

## レスポンス本文

このメソッドから返されるのは、一部のセッション データがインラインで含まれる、セッション参照の JSON 配列です。

```cpp theme={null}
{
    "results": [ {
            "xuid": "9876",    // If the session was found from a xuid, that xuid.
            "startTime": "2009-06-15T13:45:30.0900000Z",
            "sessionRef": {
                "scid": "foo",
                "templateName": "bar",
                "name": "session-seven"
            },
            "accepted": 4,    // Approximate number of non-reserved members.
            "status": "active",    // or "reserved" or "inactive". This is the state of the user in the session, not the session itself. Only present if the session was found using a xuid.
            "visibility": "open",    // or "private", "visible", or "full"
            "joinRestriction": "local",    // or "followed". Only present if 'visibility' is "open" or "full" and the session has a join restriction.
            "myTurn": true,    // Not present is the same as 'false'. Only present if the session was found using a xuid.
            "keywords": [ "one", "two" ]
        }
    ]
}

```

## 関連項目

##### 親

[/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessions.md)


## Related topics

- [GET (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName})](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenameget.md)
- [GET (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName})](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessionssessionnameget.md)
- [/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatename.md)
- [/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessions.md)
- [/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/sessions/{sessionName}](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessionssessionname.md)
