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

> Gets the titleId for the PFServiceConfig associated with an entity handle.

Gets the titleId for the PFServiceConfig associated with an entity handle.

## Syntax

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

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle returned from an auth call.

**`titleIdSize`**   size\_t

Size of the provided buffer. Required size can be obtained via PFEntityGetAPIEndpointSize.

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

Buffer the titleId string will be written to.

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

The number of bytes used in the buffer including the null terminator.

### Return value

Type: HRESULT

Result code for this API operation.

## Requirements

**Header:** PFEntity.h

## See also

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


## Related topics

- [Entity Handles](https://docs.xbox.com/services/playfab/sdks/c/entity-handles.md)
- [Services C API overview - PFEntity.h](https://docs.xbox.com/services/playfab/api-references/c/pfentity/pfentity_members.md)
- [PFEntityGetTitleIdSize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygettitleidsize.md)
- [GET /titles/{titleId}/users/{xuid}/activities API](https://docs.xbox.com/reference/live/rest/uri/multiplayeractivity/swagger-uris/uri-GetActivity.md)
- [PartyLocalUser::GetEntityId](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentityid.md)
