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

# chat_user::xbox_user_id

> chat_user::xbox_user_id

# chat\_user::xbox\_user\_id

Returns the unique XBOX User ID of this user.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
_Ret_z_ xbox_user_id(  
)  
```

<a id="parametersSection" />

### Parameters

None.

<a id="retvalSection" />

### Return value

Type: \_Ret\_z\_

Returns a pointer to a null-terminated string that represents the unique XBOX User ID of this user.

<a id="remarksSection" />

## Remarks

This method returns a pointer to a null-terminated string that represents the unique XBOX User ID for this [chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user) object. The memory for the returned string pointer remains valid for the life of the `chat_user object`, which is until the user has been removed by a call to the [chat\_manager::remove\_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_remove_user) method. For more information about managing users with the local [chat\_manager](/reference/chat/gamechat2/classes/chat_manager/chat_manager) instance for your app, see the [Adding users to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2#adding_users_to_game_chat_2) section in [Using the Game Chat 2 C++ API](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2).

<a id="requirementsSection" />

## Requirements

**Header:** GameChat2.h

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[Intro to Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_user::custom\_user\_context](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_custom_user_context)\
[chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user)


## Related topics

- [PartyXblManager::CreateRemoteChatUser](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_createremotechatuser.md)
- [chat_manager::add_local_user](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_add_local_user.md)
- [PartyXblChatUser::GetXboxUserId](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getxboxuserid.md)
- [chat_user::chat_indicator](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_chat_indicator.md)
- [chat_user::local](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function_2.md)
