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

# 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](https://docs.xbox.com/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

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.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[xbox\_live\_context\_c](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_context_c/xbox_live_context_c_members.md)


## Related topics

- [xbox_live_context_c (contents)](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_context_c/xbox_live_context_c_members.md)
- [XblContextGetUser](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_context_c/functions/xblcontextgetuser.md)
- [PartyXblManager::GetEntityIdsFromXboxLiveUserIds](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getentityidsfromxboxliveuserids.md)
- [PartyXblChatUser::GetCustomContext](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getcustomcontext.md)
- [XblUserStatisticsGetSingleUserStatisticAsync](https://docs.xbox.com/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticasync.md)
