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

# 張貼最近玩家

> 張貼最近玩家

# 張貼最近玩家

附加至或更新使用者的最近玩家清單 (單向)。

此 API 可讓遊戲用戶端附加至使用者的最近玩家清單，並更新現有的最近玩家項目。此呼叫只會影響呼叫者的最近玩家清單 (單向)。

```http theme={null}
POST /titles/{titleId}/recentplayers
```

<a id="uri-parameters" />

## URI 參數

| 參數 | 位置 | 必要 | 類型 | 描述 |
| - | - | - | - | - |
| titleId | path | TRUE | integer | 傳送要求的目標遊戲 titleId。 |

<a id="request-header" />

## 要求標頭

| 名稱 | 必要 | 類型 | 描述 |
| - | - | - | - |
| Authorization | TRUE | integer | 呼叫者必須以 XBL 3.0 授權格式提供 XToken。例如，Authorization: XBL3.0 x=2553948354698;>encrypted token\<) |
| Content-Type | TRUE | string | ContentType 必須設定為 application/json |

<a id="request-body" />

## 要求本文

| 名稱 | 必要 | 類型 | 描述 |
| - | - | - | - |
| recentPlayers | TRUE | | 此使用者的最近玩家陣列。應至少有 1 位、最多 100 位最近玩家。 |

<a id="responses" />

## 回應

| 名稱 | 類型 | 描述 |
| - | - | - |
| 204 No Content | | 已成功傳送最近玩家要求。 |
| 400 Bad Request | [ErrorResponse](#errorresponse) | 處理要求時發生錯誤。可能的錯誤碼："RequestValidationError: The request validation has failed.", " AuthorizationError: The caller is not allowed to access the resource." |
| 其他狀態碼 | [ThrottledEntity](#throttledentity) | 要求過多。標頭 Retry-After: integer |

<a id="definitions" />

## 定義

* [ClientRecentPlayersRequest](#clientrecentplayersrequest)
* [EncounterType](#encountertype)
* [ErrorResponse](#errorresponse)
* [Network](#network)
* [ThrottledEntity](#throttledentity)

<a id="clientrecentplayersrequest" />

### ClientRecentPlayersRequest

| 名稱 | 類型 | 描述 |
| - | - | - |
| recentPlayers | | 此使用者的最近玩家陣列。應至少有 1 位、最多 100 位最近玩家。 |

<a id="encountertype" />

### EncounterType

最近玩家相遇的類型。此欄位為選擇性，預設為 Default。Default 沒有規定的意義，由呼叫者自行適當解讀此值。

| 名稱 | 類型 | 描述 |
| - | - | - |
| Default | string | |
| Opponent | string | |
| Teammate | string | |

<a id="errorresponse" />

### ErrorResponse

| 名稱 | 類型 | 描述 |
| - | - | - |
| debugMessage | string | 可用於偵錯的人類可讀錯誤訊息版本。 |
| errorCode | string | 錯誤碼列舉。 |

<a id="network" />

### Network

| 名稱 | 類型 | 描述 |
| - | - | - |
| XboxLive | string | |

<a id="throttledentity" />

### ThrottledEntity

| 名稱 | 類型 | 描述 |
| - | - | - |
| currentRequests | string | 目前的要求數 - 並行或速率。 |
| debugMessage | string | 可用於偵錯的人類可讀節流訊息版本。 |
| limitType | string | 限制類型，即並行或速率。 |
| maxRequests | string | 允許的最大要求數 - 並行或速率。 |
| periodInSeconds | string | 超過速率或並行限制時套用的期間 (以秒為單位)。 |
| version | string | 目前的節流合約版本。 |


## Related topics

- [最近玩家](/zh-CN/services/xbox-services/multiplayer/mpa/concepts/live-mpa-recent-players.md)
- [与 PlayFab Lobby 和 Match 集成](/zh-CN/services/xbox-services/multiplayer/mpa/concepts/live-mpa-playfab-integration.md)
- [为多人游戏启用大型会话](/zh-CN/services/xbox-services/multiplayer/mpsd/concepts/live-large-sessions.md)
- [Multiplayer Activity 示例代码](/zh-CN/services/xbox-services/multiplayer/mpa/how-to/live-mpa-client-how-to.md)
- [从 MPSD 迁移到 PlayFab Multiplayer 和 MPA](/zh-CN/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
