Ubi Api
Laxis edited this page Aug 28, 2018
·
5 revisions
notes:
- user defined params are prefixed with an @
- CSL means comma-seperated list
every request to data endpoints has to content several headers:
- content-type we always use "application/json; charset=UTF-8"
- ubi-appid
seems to be for logging on ubis end. We use
39baebad-39e5-4552-8c25-2c9b919064e2
(the same as ubi frontend) - authorization
Ubi_v1 t=@ticket
@ticket
is the ticket returned when logging in (see below)
Send a POST request to: https://uplayconnect.ubi.com/ubiservices/v2/profiles/sessions
an authorization
header should be set according to the Basic Auth scheme:
"Basic " + Base.encode64(@user + ":" + @pass)
on successful login the server will return with the following:
! remember to re-auth before the expiration time
{
"token": "d/EavoH6jUOutYCld5atQQ==",
"ticket": "..", // important !
"twoFactorAuthenticationTicket": null,
"expiration": "2018-01-24T21:15:53.9415212Z",
"platformType": "uplay",
"profileId": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
"userId": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
"username": "..",
"nameOnPlatform": "LaxisB",
"initializeUser": true,
"spaceId": "632df4a5-4fd7-4ee5-a0c8-1f221f7e585f",
"environment": "Prod",
"hasAcceptedLegalOptins": true,
"accountIssues": null,
"sessionId": "1d07796b-1560-4f74-8658-fdf2a18c220a",
"clientIp": "..",
"serverTime": "2018-01-24T18:15:53.9885224Z",
"rememberMeTicket":
".."
}
-
urls:
-
params:
- key
- nameOnPlatform
- idOnPlatform
- vals name or id (it seems to also accept multiple as CSL)
- key
-
example response:
{ "profiles": [ { "profileId": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2", "userId": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2", "platformType": "uplay", "idOnPlatform": "CCD28CC4-845E-4726-8CF8-E2CAC4DE82A2", "nameOnPlatform": "NaughtyMuppet" } ] }
-
notes
- userId is unique per account
- when getting a profile by userId it also returns connected accounts
-
urls:
- psn: "https://public-ubiservices.ubi.com/v1/spaces/05bfb3f7-6c21-4c42-be1f-97a33fb5cf66/sandboxes/OSBOR_PS4_LNCH_A/r6playerprofile/playerprofile/progressions?profile_ids=@ids"
- xbl: "https://public-ubiservices.ubi.com/v1/spaces/98a601e5-ca91-4440-b1c5-753f601a2c90/sandboxes/OSBOR_XBOXONE_LNCH_A/r6playerprofile/playerprofile/progressions?profile_ids=@ids"
- uplay: "https://public-ubiservices.ubi.com/v1/spaces/5172a557-50b5-4665-b7db-e3f2e8c5041d/sandboxes/OSBOR_PC_LNCH_A/r6playerprofile/playerprofile/progressions?profile_ids=@ids"
-
params:
- ids CSL of profileIds
-
example response:
{ "player_profiles": [ { "xp": 5858, "profile_id": "09ef2790-ee5a-4909-b9dc-4e4042dbed7d", "lootbox_probability": 4150, "level": 284 } ] }
-
urls
- psn: "https://public-ubiservices.ubi.com/v1/spaces/05bfb3f7-6c21-4c42-be1f-97a33fb5cf66/sandboxes/OSBOR_PS4_LNCH_A/playerstats2/statistics?populations=@ids&statistics=@stats"
- xbl: "https://public-ubiservices.ubi.com/v1/spaces/98a601e5-ca91-4440-b1c5-753f601a2c90/sandboxes/OSBOR_XBOXONE_LNCH_A/playerstats2/statistics?populations=@ids&statistics=@stats"
- uplay: "https://public-ubiservices.ubi.com/v1/spaces/5172a557-50b5-4665-b7db-e3f2e8c5041d/sandboxes/OSBOR_PC_LNCH_A/playerstats2/statistics?populations=@ids&statistics=@stats"
-
params:
- ids CSL ofprofileIds
- stats CSL of stats
-
example response:
{ "results": { "1b50085a-8a20-4ce6-b75f-db6a00e4d718": { "casualpvp_matchwon:infinite": 1477, "rankedpvp_timeplayed:infinite": 496448, "rankedpvp_matchlost:infinite": 92, "casualpvp_matchlost:infinite": 491, "rankedpvp_death:infinite": 1447, "casualpvp_timeplayed:infinite": 1516832, "rankedpvp_matchwon:infinite": 322, "rankedpvp_kills:infinite": 1405, "casualpvp_matchplayed:infinite": 1968, "casualpvp_death:infinite": 4378, "rankedpvp_matchplayed:infinite": 414, "casualpvp_kills:infinite": 5621 } } }
-
notes
- ignore the
:infinite
part. - the
:1:2:
part in the operator stats is an operators' index. - check this gist for the relevant constants
- ignore the
-
urls
- psn: "https://public-ubiservices.ubi.com/v1/spaces/05bfb3f7-6c21-4c42-be1f-97a33fb5cf66/sandboxes/OSBOR_PS4_LNCH_A/r6karma/players?board_id=pvp_ranked®ion_id=@region&season_id=@season&profile_ids=@ids"
- xbl: "https://public-ubiservices.ubi.com/v1/spaces/98a601e5-ca91-4440-b1c5-753f601a2c90/sandboxes/OSBOR_XBOXONE_LNCH_A/r6karma/players?board_id=pvp_ranked®ion_id=@region&season_id=@season&profile_ids=@ids"
- uplay: "https://public-ubiservices.ubi.com/v1/spaces/5172a557-50b5-4665-b7db-e3f2e8c5041d/sandboxes/OSBOR_PC_LNCH_A/r6karma/players?board_id=@board®ion_id=@region&season_id=@season&profile_ids=@ids"
-
params:
- board
pvp_ranked
no clue of there are alternatives - region:
emea
,ncsa
orapac
- season
-1
for current season, otherwise an incrementing integer (y2s2 is 5) - ids CSL of profileIds
- board
-
example response:
{ "players": { "1b50085a-8a20-4ce6-b75f-db6a00e4d718": { "board_id": "pvp_ranked", "past_seasons_abandons": 0, "update_time": "2018-01-21T19:26:44.440000+00:00", "skill_mean": 43.1754432515, "abandons": 0, "season": 8, "region": "emea", "profile_id": "1b50085a-8a20-4ce6-b75f-db6a00e4d718", "past_seasons_losses": 21, "max_mmr": 4387.00039284, "mmr": 4317.54432515, "wins": 23, "skill_stdev": 6.44806717385, "rank": 19, "losses": 6, "next_rank_mmr": 4500.0, "past_seasons_wins": 53, "previous_rank_mmr": 4100.0, "max_rank": 19 } } }
-
notes
- seasons older than 6 return default values. ubi is 'working on it'