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

# PFEntityGetTitleId

> 取得與實體控制代碼相關聯之 PFServiceConfig 的 titleId。

取得與實體控制代碼相關聯之 PFServiceConfig 的 titleId。

## 語法

```cpp theme={null}
HRESULT PFEntityGetTitleId(  
    PFEntityHandle entityHandle,  
    size_t titleIdSize,  
    char* titleIdBuffer,  
    size_t* titleIdUsed  
)  
```

### 參數

**`entityHandle`**   PFEntityHandle

從驗證呼叫傳回的 PFEntityHandle。

**`titleIdSize`**   size\_t

所提供緩衝區的大小。所需大小可透過 PFEntityGetAPIEndpointSize 取得。

**`titleIdBuffer`**   char\*\
**Out\_writes*(titleIdSize)*

titleId 字串將寫入的緩衝區。

**`titleIdUsed`**   size\_t\*\
*optional output*

緩衝區中已使用的位元組數目，包括 null 結束字元。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 需求

**標頭：** PFEntity.h

## 另請參閱

[PFEntity 成員](https://docs.xbox.com/zh-TW/services/playfab/api-references/c/pfentity/pfentity_members.md)


## Related topics

- [服務 C API 概觀 - PFEntity.h](https://docs.xbox.com/zh-TW/services/playfab/api-references/c/pfentity/pfentity_members.md)
- [實體控制代碼](https://docs.xbox.com/zh-TW/services/playfab/sdks/c/entity-handles.md)
- [PFEntityGetTitleIdSize](https://docs.xbox.com/zh-TW/services/playfab/api-references/c/pfentity/functions/pfentitygettitleidsize.md)
- [GET /titles/{titleId}/users/{xuid}/activities API](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-GetActivity.md)
- [POST /titles/{titleId}/activities/query](https://docs.xbox.com/zh-TW/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-ExternalGetActivityBatch.md)
