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

# XblContextGetXboxUserId

> XblContextGetXboxUserId

# XblContextGetXboxUserId

Get the XBOX user ID of the user associated with the context.

## Syntax

```cpp theme={null}
HRESULT XblContextGetXboxUserId(  
         XblContextHandle context,  
         uint64_t* xboxUserId  
)  
```

### Parameters

*context*   \_In\_\
Type: [XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

The XBOX Live context handle.

*xboxUserId*   \_Out\_\
Type: uint64\_t\*

Passes back the xbox user ID.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Requirements

**Header:** xbox\_live\_context\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[xbox\_live\_context\_c](/reference/live/xsapi-c/xbox_live_context_c/xbox_live_context_c_members)


## Related topics

- [XblContextGetUser](/reference/live/xsapi-c/xbox_live_context_c/functions/xblcontextgetuser.md)
- [PartyXblManager::GetEntityIdsFromXboxLiveUserIds](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getentityidsfromxboxliveuserids.md)
- [PartyXblChatUser::GetXboxUserId](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getxboxuserid.md)
- [XblUserStatisticsGetSingleUserStatisticAsync](/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticasync.md)
- [XblProfileGetUserProfileAsync](/reference/live/xsapi-c/profile_c/functions/xblprofilegetuserprofileasync.md)
