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

# POST (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/batch)

> POST (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/batch)

# POST (/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/batch)

複数の XBOX ユーザー ID に対するバッチ クエリを作成します。

> **重要:**\
> このメソッドは 2015 Multiplayer で使用され、そのマルチプレイヤー バージョン以降にのみ適用されます。テンプレート コントラクト 104/105 以降での使用を意図しており、すべてのリクエストにヘッダー要素 X-Xbl-Contract-Version: 104/105 以降が必要です。

* [解説](#ID4ET)
* [URI パラメーター](#ID4EKB)
* [クエリ文字列パラメーター](#ID4EVB)
* [HTTP ステータス コード](#ID4EGF)
* [リクエスト本文](#ID4ENF)
* [レスポンス本文](#ID4EWF)

## 解説

この HTTP/REST メソッドは、セッション テンプレート レベルで複数の XBOX ユーザー ID に対するバッチ クエリを作成します。このメソッドは **Microsoft.Xbox.Services.Multiplayer.MultiplayerService.GetSessionsForUsersFilterAsync** によってラップできます。

2015 Multiplayer では、*xuid* クエリ文字列パラメーターで表される、異なる XBOX ユーザー ID (XUID) を扱う点を除きすべて同じであるクエリを、単一の呼び出しにまとめることができます。通常のクエリとバッチ クエリで、クエリ文字列パラメーターとレスポンスは同じであることに注意してください。

バッチ クエリでは、各 XUID に属するセッションは、リクエストで示された *xuid* パラメーターと同じ順序でレスポンスに書き込まれます。同じセッションがレスポンス内に複数回、一致した *xuid* ごとに 1 回ずつ出現する可能性があります。

## URI パラメーター

\| パラメーター | 型 | 説明 |
\| --- | --- | --- | --- |
\| scid| GUID| サービス構成識別子 (SCID)。セッション識別子のパート 1。|
\| sessionTemplateName| string| セッション テンプレートの現在のインスタンスの名前。セッション識別子のパート 2。|

## クエリ文字列パラメーター

クエリは、次の表のクエリ文字列パラメーターを使用して変更できます。

\| **パラメーター**| **型**| **説明**|
\| --- | --- | --- | --- | --- | --- | --- |
\| keyword| string| 取得対象のセッションまたはテンプレートに含まれている必要のあるキーワード (例: "foo")。 |
\| xuid| 64-bit unsigned integer| クエリに含めるセッションの XBOX ユーザー ID (例: "123")。既定では、ユーザーがセッションに含まれるためには、そのセッションでアクティブである必要があります。 |
\| reservations| boolean| ユーザーが予約プレイヤーとして設定されているがアクティブ プレイヤーとして参加していないセッションを含めるには true。このパラメーターは、自分自身のセッションを問い合わせる場合、または特定のユーザーのセッションをサーバー間で問い合わせる場合にのみ使用されます。 |
\| inactive| boolean| ユーザーが承諾しているがアクティブにプレイしていないセッションを含めるには true。ユーザーが "ready" だが "active" でないセッションは非アクティブとしてカウントされます。 |
\| private| boolean| プライベート セッションを含めるには true。このパラメーターは、自分自身のセッションを問い合わせる場合、または特定のユーザーのセッションをサーバー間で問い合わせる場合にのみ使用されます。 |
\| visibility| string| セッションの可視性の状態。可能な値は **MultiplayerSessionVisibility** で定義されています。このパラメーターが "open" に設定されている場合、クエリはオープン セッションのみを含める必要があります。"private" に設定されている場合は、*private* パラメーターを true に設定する必要があります。 |
\| version| 32-bit signed integer| 含める最大セッション バージョン。たとえば、値 2 は、メジャー セッション バージョンが 2 以下のセッションのみを含めるように指定します。バージョン番号は、リクエストのコントラクト バージョンを 100 で割った剰余以下である必要があります。 |
\| take| 32-bit signed integer| 取得するセッションの最大数。この数は 0 から 100 の間である必要があります。 |

*private* または *reservations* のいずれかを true に設定するには、セッションに対するサーバー レベル アクセス権が必要です。あるいは、これらの設定には、呼び出し元の XUID クレームが URI 内の XUID フィルターと一致することが必要です。それ以外の場合、該当するセッションが実際に存在するかどうかにかかわらず、HTTP/403 ステータス コードが返されます。

## HTTP ステータス コード

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

## リクエスト本文

```cpp theme={null}
{ "xuids": [ "1234", "5678" ] }

```

## レスポンス本文

このメソッドから返されるのは、一部のセッション データがインラインで含まれる、セッション参照の 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}/batch](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigscidsessiontemplatessessiontemplatenamebatch.md)


## Related topics

- [/serviceconfigs/{scid}/sessiontemplates/{sessionTemplateName}/batch](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigscidsessiontemplatessessiontemplatenamebatch.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)
- [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)](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidsessiontemplatessessiontemplatenamesessionsget.md)
