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

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

## 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()](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getentitytype) would represent the other half of a `PFEntityKey`. <br /><br /> If this endpoint isn't associated with a user, `entityId` is set to nullptr.   <br /><br /> The memory for the Entity ID string remains valid for the life of the endpoint, which is until its [PartyEndpointDestroyedStateChange](/services/playfab/multiplayer/networking/reference/structs/partyendpointdestroyedstatechange) and/or [PartyDestroyEndpointCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partydestroyendpointcompletedstatechange), depending on the type of destruction that occurred, has been provided via [PartyManager::StartProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges) and all state changes referencing the endpoint have been returned to [PartyManager::FinishProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_finishprocessingstatechanges).

## Requirements

**Header:** Party.h

## See also

[PartyEndpoint](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/partyendpoint)\
[PartyEndpoint::GetEntityType](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getentitytype)


## Related topics

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