Closed kufhjer closed 3 years ago
Not possible with current script, ill add it and push it.
More info; https://docs.microsoft.com/en-us/gaming/xbox-live/xbox-live-rest/uri/marketplace/uri-inventoryget
@BeLimitless guess you figured this out, but I did it like this. Note that I am querying the actual API URL not using the call provided but something similar should work.
headers = {'Authorization':'XBL3.0 x='+uhs+';'+XSTSToken}
continuationToken = ''
while True:
response = APIhttp.http.get('https://achievements.xboxlive.com/users/xuid({})/achievements?continuationToken={}'.format(xuid,continuationToken),headers=headers)
json_data = json.loads(response.text)
continuationToken = json_data['pagingInfo']['continuationToken']
if not continuationToken:
break
print(continuationToken)
@JBrame I used the build-in client to fetch the URL for achievements.
achievement_data = xbl_client.session.get("https://achievements.xboxlive.com/users/xuid(2535431190592405)/achievements?", params={'titleId': str(options['title_id']), 'continuationToken': int(continuation_token)}, headers={'x-xbl-contract-version': '2'})
achievement_data = xbl_client.session.get("https://achievements.xboxlive.com/users/xuid(2535431190592405)/achievements?", params={'titleId': str(options['title_id']), 'continuationToken': int(continuation_token)}, headers={'x-xbl-contract-version': '2'})
Since v2.0.10 you can do this finally in a native way:
await xbl_client.achievements.get_achievements_xboxone_gameprogress(
'2535431190592405',
title_id,
extra_params={'continuationToken': continuation_token}
)
How to handle multiple pages on result?
When fetching achievements;
achievement_data = xbl_client.achievements.get_achievements_xboxone_gameprogress(token['token_xuid'], '1828326430') achievement_data = json.loads(achievement_data.text)
Part of the result is;
'pagingInfo': {'continuationToken': '32', 'totalRecords': 103},
How do I access the rest of the result? I need to make a new request but need to use the continuationToken.