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

# 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\*](/services/playfab/multiplayer/networking/reference/typedefs)\
*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()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## Remarks

The retrieved PlayFab Entity ID is identical to the Entity ID provided by the title via [PartyManager::CreateLocalUser()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluser) or [PartyManager::CreateLocalUserWithEntityType()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluserwithentitytype). 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()](/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentitytype) would represent the other half of a `PFEntityKey`. <br /><br /> The memory for the Entity ID string remains valid for the life of the local user, which is until its [PartyDestroyLocalUserCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partydestroylocalusercompletedstatechange) has been provided via [PartyManager::StartProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges) and all state changes referencing the local user have been returned to [PartyManager::FinishProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_finishprocessingstatechanges).

## Requirements

**Header:** Party.h

## See also

[PartyLocalUser](/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/partylocaluser)\
[PartyLocalUser::GetEntityType](/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentitytype)\
[PartyManager::CreateLocalUser](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluser)\
[PartyManager::CreateLocalUserWithEntityType](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_createlocaluserwithentitytype)


## Related topics

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