Im using the python requests library.
So I have their xbl3.0 token and I was wondering how I could get their xuid. I've searched the documentation and found this yet it doesnt specify any authorization headers.
pls help im so confused.
def getownerxuid():
with open('configs/realminfo.json') as temp_json_file:
xbltoken = json.load(temp_json_file)["xbltoken"]
url = "https://userpresence.xboxlive.com/users/me"
url = "https://profile.xboxlive.com/users/me/profile/settings/people/people"
headers = {
"Authorization": f"{xbltoken}",
"x-xbl-contract-version": "2",
"content-type": "application/json"
}
params = {
"settings": "GameDisplayName,GameDisplayPicRaw,Gamerscore,Gamertag"
}
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
print(response["xuid"])
data = response.json()
else: print(f"Request failed with status code: {response.status_code}")
Im expecting to get the response from this but instead I just recieve error 403. I know my token is not incorrect as it works fine on the realms api which uses the same token.
You can get the Xbox profile associated with the token using the "DisplayClaims" response from XSTS Authorize endpoint. Here's an example of how to format the request: