> ## 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}/batch)

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

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

針對服務設定的多個 XBOX 使用者識別碼建立批次查詢。

> **重要：**\
> 此方法由 2015 多人遊戲使用，僅適用於該多人遊戲版本及更新版本。其適用於範本合約 104/105 或更新版本，且每個要求都需要 X-Xbl-Contract-Version: 104/105 或更新版本的標頭元素。

* [備註](#ID4ET)
* [URI 參數](#ID4ELB)
* [查詢字串參數](#ID4EVB)
* [HTTP 狀態碼](#ID4EGF)
* [要求本文](#ID4ENF)
* [回應本文](#ID4EWF)

<a id="ID4ET" />

## 備註

此 HTTP/REST 方法會在服務設定識別碼 (SCID) 層級，針對多個 XBOX 使用者識別碼建立批次查詢。此方法可由 **Microsoft.Xbox.Services.Multiplayer.MultiplayerService.GetSessionsForUsersFilterAsync** 包裝。

對於 2015 多人遊戲，如果所有查詢都相同，只是處理不同的 XBOX 使用者識別碼 (XUID) (如 *xuid* 查詢字串參數所表示)，您可以將許多查詢合併成單一呼叫。請注意，一般查詢和批次查詢的查詢字串參數和回應都相同。

對於批次查詢，屬於每個 XUID 的工作階段會依照 *xuid* 參數在要求中出現的相同順序寫入回應。同一個工作階段可能會在回應中出現多次，每個符合的 *xuid* 各出現一次。

<a id="ID4ELB" />

## URI 參數

\| 參數| 類型| 描述|
\| --- | --- | --- | --- |
\| scid| GUID| 服務設定識別碼 (SCID)。工作階段識別碼的第 1 部分。|

<a id="ID4EVB" />

## 查詢字串參數

您可以使用下表中的查詢字串參數修改查詢。

\| <b>參數</b>| <b>類型</b>| <b>描述</b>|
\| --- | --- | --- | --- | --- | --- | --- |
\| keyword| string| 關鍵字，例如 "foo"，工作階段或範本中必須包含此關鍵字才會被擷取。 |
\| xuid| 64 位元不帶正負號的整數| 要包含在查詢中之工作階段的 XBOX 使用者識別碼，例如 "123"。根據預設，使用者必須在工作階段中處於作用中狀態，該工作階段才會被包含。 |
\| reservations| boolean| True 表示包含使用者被設為保留玩家但尚未加入成為作用中玩家的工作階段。只有在查詢您自己的工作階段，或以伺服器對伺服器方式查詢特定使用者的工作階段時，才會使用此參數。 |
\| inactive| boolean| True 表示包含使用者已接受但未在積極遊玩的工作階段。使用者處於 "ready" 但非 "active" 狀態的工作階段會視為非作用中。 |
\| private| boolean| True 表示包含私人工作階段。只有在查詢您自己的工作階段，或以伺服器對伺服器方式查詢特定使用者的工作階段時，才會使用此參數。 |
\| visibility| string| 工作階段的可見性狀態。可能的值由 <b>MultiplayerSessionVisibility</b> 定義。如果此參數設為 "open"，查詢應只包含開放的工作階段。如果設為 "private"，則 <i>private</i> 參數必須設為 true。 |
\| version| 32 位元帶正負號的整數| 應包含的最大工作階段版本。例如，值為 2 表示只應包含主要工作階段版本為 2 或以下的工作階段。版本號碼必須小於或等於要求的合約版本除以 100 的餘數。 |
\| take| 32 位元帶正負號的整數| 要擷取的工作階段數目上限。此數字必須介於 0 到 100 之間。 |

將 *private* 或 *reservations* 設為 true 時，需要具備工作階段的伺服器層級存取權。或者，這些設定需要呼叫者的 XUID 宣告符合 URI 中的 XUID 篩選條件。否則，無論是否確實存在此類工作階段，都會傳回 HTTP/403 狀態碼。

<a id="ID4EGF" />

## HTTP 狀態碼

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

<a id="ID4ENF" />

## 要求本文

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

```

<a id="ID4EWF" />

## 回應本文

此方法的傳回值是工作階段參考的 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" ]
    }
  ]
}

```

<a id="ID4EDG" />

## 另請參閱

<a id="ID4EFG" />

##### 上層

[/serviceconfigs/{scid}/batch](/zh-TW/reference/live/rest/uri/sessiondirectory/uri-serviceconfigsscidbatch)


## Related topics

- [IDs de configuração dos serviços do XBOX para Managed Partners](/pt-BR/services/xbox-services/fundamentals/portal-config/live-service-config-ids-mp.md)
- [ID de configuration des services XBOX, pour les partenaires gérés](/fr/services/xbox-services/fundamentals/portal-config/live-service-config-ids-mp.md)
- [Multiplayer Session Directory overview](/services/xbox-services/multiplayer/mpsd/live-mpsd-overview.md)
- [XBOX services 構成 ID (Managed Partners 向け)](/ja-jp/services/xbox-services/fundamentals/portal-config/live-service-config-ids-mp.md)
- [XblMultiplayerSessionReferenceUri](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreferenceuri.md)
