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

# PFMatchmakingTicketGetTicketId

> 擷取指派給 PlayFab Multiplayer 配對票證的唯一票證識別碼，用於從其他用戶端工作階段加入或參考該票證。

提供票證識別碼。

## 語法

```cpp theme={null}
HRESULT PFMatchmakingTicketGetTicketId(  
    PFMatchmakingTicketHandle ticket,  
    const char** id  
)  
```

### 參數

**`ticket`**   PFMatchmakingTicketHandle

配對票證的控制代碼。

**`id`**   char\*\*\
*程式庫配置的輸出*

票證識別碼。

### 傳回值

類型：HRESULT

如果呼叫成功，則為 `S_OK`；否則為錯誤碼。可透過 [PFMultiplayerGetErrorMessage()](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage) 擷取錯誤碼的人類可讀形式。

## 備註

如果尚未設定票證識別碼，它將是空字串。這可能在下列其中一種條件下發生：

* 票證處於 `PFMatchmakingTicketStatus::Creating` 狀態
* 由於無法將票證提交至配對服務，票證處於 `PFMatchmakingTicketStatus::Failed` 狀態
* 票證在提交至配對服務之前已被取消

## 需求

**標頭：** PFMatchmaking.h

## 另請參閱

[PFMatchmaking 成員](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members)


## Related topics

- [PFMultiplayer C/C++ API 概觀 - PFMatchmaking.h](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md)
- [PlayFab Multiplayer C++ SDK 版本資訊](/zh-TW/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [Get Matchmaking Ticket](/api-reference/matchmaking/get-matchmaking-ticket.md)
- [MatchmakingTicket.TicketId](/zh-TW/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/MatchmakingTicket/TicketId.md)
- [PFMultiplayerJoinMatchmakingTicketFromId](/zh-TW/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmultiplayerjoinmatchmakingticketfromid.md)
