> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /titles/{titleId}/recentplayers

> 張貼最近玩家

# 張貼最近玩家

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

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

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

## URI 參數

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

## 要求標頭

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

## 要求本文

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

## 回應

| 名稱 | 類型 | 描述 |
| - | - | - |
| 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 |

## 定義

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

### ClientRecentPlayersRequest

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

### EncounterType

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

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

### ErrorResponse

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

### Network

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

### ThrottledEntity

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


## Related topics

- [POST /titles/{titleId}/recentplayers/server](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-PostServerUniRecentPlayers.md)
- [POST /titles/{titleId}/recentplayergroups/server](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-PostServerRecentPlayerGroup.md)
- [POST /titles/{titleId}/invites](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-SendInvite.md)
- [POST /titles/{titleId}/activities/query](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-ExternalGetActivityBatch.md)
- [POST /titles/{titleId}/invites/server API](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-SendServerInvite.md)
