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

# PartyLocalUser::GetEntityId

> Gets the PlayFab Entity ID associated with this local user.

Gets the PlayFab Entity ID associated with this local user.

## Syntax

```cpp theme={null}
PartyError GetEntityId(  
    PartyString* entityId  
)  
```

### Parameters

**`entityId`**   [PartyString\*](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/typedefs.md)\
*library-allocated output*

The output Entity ID of the user.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PartyManager::GetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage.md).

## Remarks

The retrieved PlayFab Entity ID is identical to the Entity ID provided by the title via [PartyManager::CreateLocalUser()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluser.md) or [PartyManager::CreateLocalUserWithEntityType()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluserwithentitytype.md). This is also the same value as the one found in the *id* field of a `PFEntityKey` structure representing the entity. The value returned from [GetEntityType()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentitytype.md) would represent the other half of a `PFEntityKey`. \
\
&#x20;The memory for the Entity ID string remains valid for the life of the local user, which is until its [PartyDestroyLocalUserCompletedStateChange](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partydestroylocalusercompletedstatechange.md) has been provided via [PartyManager::StartProcessingStateChanges()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges.md) and all state changes referencing the local user have been returned to [PartyManager::FinishProcessingStateChanges()](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_finishprocessingstatechanges.md).

## Requirements

**Header:** Party.h

## See also

[PartyLocalUser](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/partylocaluser.md)\
[PartyLocalUser::GetEntityType](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentitytype.md)\
[PartyManager::CreateLocalUser](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluser.md)\
[PartyManager::CreateLocalUserWithEntityType](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluserwithentitytype.md)


## Related topics

- [PartyLocalUser::GetEntityType](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentitytype.md)
- [PartyLocalUser::UpdateEntityToken](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_updateentitytoken.md)
- [PartyEndpoint::GetEntityId](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getentityid.md)
- [PartyChatControl::GetEntityId](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getentityid.md)
- [PartyLocalUser::GetCustomContext](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getcustomcontext.md)
