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

# PartyEndpoint::GetEntityId

> Gets the PlayFab Entity ID of the user associated with this endpoint.

Gets the PlayFab Entity ID of the user associated with this endpoint.

## 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, may return nullptr*

The output Entity ID of the user associated with this endpoint, or nullptr.

### 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 returned string is 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/PartyEndpoint/methods/partyendpoint_getentitytype.md) would represent the other half of a `PFEntityKey`. \
\
&#x20;If this endpoint isn't associated with a user, `entityId` is set to nullptr.   \
\
&#x20;The memory for the Entity ID string remains valid for the life of the endpoint, which is until its [PartyEndpointDestroyedStateChange](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partyendpointdestroyedstatechange.md) and/or [PartyDestroyEndpointCompletedStateChange](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/structs/partydestroyendpointcompletedstatechange.md), depending on the type of destruction that occurred, 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 endpoint 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

[PartyEndpoint](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/partyendpoint.md)\
[PartyEndpoint::GetEntityType](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getentitytype.md)


## Related topics

- [PartyEndpoint::GetEntityType](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getentitytype.md)
- [PartyNetwork::DestroyEndpoint](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_destroyendpoint.md)
- [PartyNetwork::CreateEndpoint](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_createendpoint.md)
- [PartyLocalUser::GetEntityId](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyLocalUser/methods/partylocaluser_getentityid.md)
- [PartyChatControl::GetEntityId](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getentityid.md)
