> ## 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 /titles/{titleId}/activities/query

> Get Activity Batch

# Get Activity Batch

ユーザーのリストに対するマルチプレイヤー アクティビティのバッチを取得します。

この API を使用すると、クライアントおよびサービスはユーザーのリストに対するアクティビティのバッチを取得できます。

この API は部分的な結果を返す場合があります。特定のユーザーに対しては完全なアクティビティのセットが返されますが、一部のユーザーではアクティビティが 1 つも存在しない場合があります。ユーザーのサブセットに対してアクティビティが見つかった場合、それらが返されます。アクティビティが見つからなかったユーザーに対しては、そのユーザーに空のリストを返します。内部エラーによりアクティビティを取得できなかったユーザーに対しては、そのユーザーに null を返します。クライアントは呼び出しを再試行する必要があります。要するに、ユーザーはアクティビティのリスト、空のリスト、または null を持つ可能性があります。

```http theme={null}
POST /titles/{titleId}/activities/query
```

## URI パラメーター

| パラメーター | 場所 | 必須 | 種類 | 説明 |
| - | - | - | - | - |
| titleId | path | TRUE | integer | リクエストが送信されているゲームの titleId。 |

## リクエスト本文

| 名前 | 必須 | 種類 | 説明 |
| - | - | - | - |
| users | TRUE | string\[] | アクティビティ情報を取得する必要があるユーザーの Id。最大 30 ユーザーがサポートされます。 |

## リクエスト ヘッダー

| 名前 | 必須 | 種類 | 説明 |
| - | - | - | - |
| Authorization | TRUE | integer | 呼び出し元は XBL 3.0 承認形式で XToken を指定する必要があります。例: Authorization: XBL3.0 x=2553948354698;>encrypted token \<) |
| Content-Type | TRUE | string | ContentType は application/json に設定する必要があります |

## 応答

| 名前 | 種類 | 説明 |
| - | - | - |
| 200 OK | [GetActivityBatchResponse](#getactivitybatchresponse) | 戻りオブジェクトには、各ユーザーのアクティビティのリストが含まれます。ユーザーに現在のアクティビティがない場合、そのユーザーのアクティビティ リストは空になります。ユーザーのアクティビティ取得中にサービスの問題が発生した場合、そのユーザーのアクティビティ リストは null になります。 |
| 400 Bad Request | [ErrorResponse](#errorresponse) | リクエスト処理中にエラーが発生しました。可能なエラー コード: "InvalidRequest - The request payload is invalid.", " AuthorizationError: The caller is not allowed to access the resource." |
| その他のステータス コード | [ThrottledEntity](#throttledentity) | リクエストが多すぎます。ヘッダー Retry-After: integer |

## 定義

* [ErrorResponse](#errorresponse)
* [GetActivityBatchRequest](#getactivitybatchrequest)
* [GetActivityBatchResponse](#getactivitybatchresponse)
* [GetActivityResponse](#getactivityresponse)
* [JoinRestriction](#joinrestriction)
* [Platform](#platform)
* [ThrottledEntity](#throttledentity)
* [UserActivity](#useractivity)

### ErrorResponse

| 名前 | 種類 | 説明 |
| - | - | - |
| debugMessage | string | デバッグに使用できる、人間が読めるエラー メッセージのバージョン。 |
| errorCode | string | エラー コード列挙型。 |

### GetActivityBatchRequest

| 名前 | 種類 | 説明 |
| - | - | - |
| users | string\[] | アクティビティ情報を取得する必要があるユーザーの Id。最大 30 ユーザーがサポートされます。 |

### GetActivityBatchResponse

| 名前 | 種類 | 説明 |
| - | - | - |
| userActivities | [UserActivity](#useractivity)\[] | |

### GetActivityResponse

| 名前 | 種類 | 説明 |
| - | - | - |
| connectionString | string | 接続文字列は、ゲームに参加するために接続クライアントに渡されるオブジェクトです。接続文字列には通常、参加するユーザーが接続できるようにするサーバー IP などの情報が含まれています。接続文字列の長さは 512 文字に制限されています。 |
| currentPlayers | integer | マルチプレイヤー アクティビティで既にユーザーと一緒にプレイしているプレーヤーの数。 |
| groupId | string | 同じゲームの一部としてプレイしているすべてのユーザーをグループ化するための一意識別子。 |
| joinRestriction | [JoinRestriction](#joinrestriction) | 現在のプレーヤーに誰が参加できるかを有効にする設定。 |
| maxPlayers | integer | 現在のアクティビティでこのプレーヤーと一緒にプレイできる最大プレーヤー数。 |
| platform | [Platform](#platform) | |
| sequenceNumber | string | これは、クライアントが各リクエストで渡す必要がある単調増加する数値 (ulong) の文字列表現です。アクティビティへの更新の順序を保証するために使用されます。sequenceNumber の良い例は、増加することが保証されているためクライアントの unix 時刻です。0 より大きく、ulong の最大値以下である必要があります。 |
| titleId | integer | アクティビティが要求されたゲームの titleId。 |

### JoinRestriction

| 名前 | 種類 | 説明 |
| - | - | - |
| Followed | string | |
| InviteOnly | string | |
| Public | string | |

### Platform

| 名前 | 種類 | 説明 |
| - | - | - |
| Android | string | |
| IOS | string | |
| Nintendo | string | |
| PlayStation | string | |
| Scarlett | string | |
| Win32 | string | |
| WindowsOneCore | string | |
| XboxOne | string | |

### ThrottledEntity

| 名前 | 種類 | 説明 |
| - | - | - |
| currentRequests | string | 現在のリクエスト数 - 同時実行またはレート。 |
| debugMessage | string | デバッグに使用できる、人間が読めるスロットル メッセージのバージョン。 |
| limitType | string | 制限の種類 (同時実行またはレート)。 |
| maxRequests | string | 許容される最大リクエスト数 - 同時実行またはレート。 |
| periodInSeconds | string | レートまたは同時実行の制限を超えたときに適用される期間 (秒単位)。 |
| version | string | 現在のスロットル コントラクトのバージョン。 |

### UserActivity

| 名前 | 種類 | 説明 |
| - | - | - |
| activities | [GetActivityResponse](#getactivityresponse)\[] | |
| userId | string | |


## Related topics

- [POST /titles/{titleId}/recentplayers](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-PostUniRecentPlayers.md)
- [POST /titles/{titleId}/invites](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-SendInvite.md)
- [POST /titles/{titleId}/recentplayers/server](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-PostServerUniRecentPlayers.md)
- [POST /titles/{titleId}/recentplayergroups/server](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-PostServerRecentPlayerGroup.md)
- [POST /titles/{titleId}/invites/server API](https://devdocs.xbox.com/ja-jp/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-SendServerInvite.md)
