Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current match infos #11

Open
sidelux opened this issue Jun 26, 2018 · 56 comments
Open

Current match infos #11

sidelux opened this issue Jun 26, 2018 · 56 comments

Comments

@sidelux
Copy link
Collaborator

sidelux commented Jun 26, 2018

(Me again!)
Days ago i notice that with uplay api you can get infos about current playing match in R6, there is a possibility to add it in this api?

Thanks!

@Seems2Legit
Copy link
Owner

Do you got any URL to the api?

@Seems2Legit
Copy link
Owner

(Btw. thank you very much for the readme :) 👍 🥇 )

@sidelux
Copy link
Collaborator Author

sidelux commented Jun 27, 2018

Uhm... apparently that endpoint not working anymore.
BUT! I have a final suggest for you, rank icons: https://pastebin.com/Y8ycfX3n ;)

@Seems2Legit
Copy link
Owner

I can do that... to getUser.php right?

@sidelux
Copy link
Collaborator Author

sidelux commented Jun 27, 2018

Yep! After this i think there are all functions ;)

@Seems2Legit
Copy link
Owner

Done.

@Seems2Legit
Copy link
Owner

Seems2Legit commented Apr 19, 2021

Uhm... apparently that endpoint not working anymore.
BUT! I have a final suggest for you, rank icons: https://pastebin.com/Y8ycfX3n ;)

Hi @sidelux, do you still have the URL (even though it doesn't work)? Because I know something like this is possible, but I haven't found a way yet, so this might help...

@Seems2Legit Seems2Legit reopened this Apr 19, 2021
@sidelux
Copy link
Collaborator Author

sidelux commented Apr 19, 2021

Can't rember and ubi website is changed too much...
Take a look here.

@SwiftCODA
Copy link
Contributor

Keep me posted if you figure this out, @Seems2Legit.

@SwiftCODA
Copy link
Contributor

@sidelux @Seems2Legit any help deciphering this would be great:

function x() {
            return (x = h()(i.a.mark(function e(t, n, r, a) {
                var o, s, c, u, l, d, f;
                return i.a.wrap(function(e) {
                    for (;;) switch (e.prev = e.next) {
                        case 0:
                            return o = r.appId, s = r.statsService, c = t.sessionId, u = t.ticket, l = t.expiration, d = "https://".concat(s, "/v1/current/summary/").concat(n), "r6s-stats-dev.ubisoft.com:443" === s && (d = "https://".concat(s, "/v1/current/summary/").concat(n)), "uplay" === (f = a.platform) ? f = "PC" : "psn" === f ? f = "PS4" : "xbl" === f && (f = "XONE"), e.abrupt("return", y()({
                                url: d,
                                method: "get",
                                params: {
                                    gameMode: a.gameMode,
                                    platform: f,
                                    startDate: a.startDate,
                                    endDate: a.endDate
                                },
                                headers: _(o, c, u, l)
                            }).then(function(e) {
                                return {
                                    response: e.data
                                }
                            }).catch(function(e) {
                                return Object(v.showErrors)("getPlayerSummary"), {
                                    error: e
                                }
                            }));
                        case 7:
                        case "end":
                            return e.stop()
                    }
                }, e)
            }))).apply(this, arguments)
        }

where u is Ubi_v1 t=LOGIN_TICKET_HERE
where o is any App ID, let's say 39baebad-39e5-4552-8c25-2c9b919064e2

Endpoints I've tried in Postman:
https://public-ubiservices.ubi.com/v1/current/summary/
https://r6s-stats-dev.ubisoft.com:443/v1/current/summary/
https://public-ubiservices.ubi.com/v1/current/summary/UBI_USER_ID_HERE
https://r6s-stats-dev.ubisoft.com:443/v1/current/summary/UBI_USER_ID_HERE

@SwiftCODA
Copy link
Contributor

@sidelux @Seems2Legit Hey guys. I did some network request scraping on the Siege app for Windows and went through the Ubisoft Connect side menu thing to make more requests and I analyzed most of them and found one of them returned this beautiful JSON containing a list of endpoints with a brief title for each one. Maybe you guys can try messing with some of them in Postman or something and seeing if any return current match info. I've played around with it a bit with someone else so let me know if you find anything or have any questions.

{
   "parameters":{
      "us-sdkClientRemoteLogsGame":{
         "fields":{
            "navigation":"None",
            "relationshipUpdate":"None",
            "playerNotifications":"None",
            "friendRecommendations":"None",
            "friends":"None",
            "url":"",
            "maxTextLength":32768,
            "uncategorized":"None"
         },
         "relatedPopulation":{
            "name":"AllLogsDisabled",
            "subject":"EndUserLogging"
         }
      },
      "us-sdkClientUrls":{
         "fields":{
            "allConnections":"https://{env}public-ubiservices.ubi.com/{version}/profiles/connections",
            "allProfilesApplications":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/applications",
            "allProfilesEntities":"https://{env}public-ubiservices.ubi.com/{version}/profiles/entities",
            "allProfilesStats":"https://{env}public-ubiservices.ubi.com/{version}/profiles/stats",
            "allSpacesEntities":"https://{env}public-ubiservices.ubi.com/{version}/spaces/entities",
            "allSpacesItems":"https://{env}public-ubiservices.ubi.com/{version}/spaces/items",
            "allSpacesOffers":"https://{env}public-ubiservices.ubi.com/{version}/spaces/offers",
            "applications":"https://{env}public-ubiservices.ubi.com/{version}/applications/{applicationId}/configuration",
            "applicationsMetadata":"https://{env}public-ubiservices.ubi.com/{version}/applications",
            "applicationsParameters":"https://{env}public-ubiservices.ubi.com/{version}/applications/{applicationId}/parameters",
            "blocklist":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/blocks",
            "blocklistBlockedBy":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/blocks/blockedBy",
            "blocklistUnblock":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/blocks/{blockedProfileId}",
            "challenge":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/challenges",
            "challengeProgression":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/challenges/progressions",
            "configsEvents":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/events",
            "connections":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/connections",
            "events":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/events",
            "eventsDefinitions":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/eventsDefinitions",
            "friends":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/me/friends",
            "gamesPlayed":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/gamesplayed",
            "localization":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/localizations/strings",
            "localizationAll":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/localizations/strings/all",
            "moderation":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/moderation/{text}",
            "moderationPOST":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/moderation",
            "news":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/me/news",
            "personaProfile":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/persona",
            "personaSpace":"https://{env}public-ubiservices.ubi.com/{version}/profiles/persona",
            "policies":"https://{env}public-ubiservices.ubi.com/{version}/policies",
            "playerReportsProfile":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/reports",
            "playerReportsSpaceCategories":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/reports/categories",
            "profiles":"https://{env}public-ubiservices.ubi.com/{version}/profiles",
            "profilesActions":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/club/actions",
            "profilesApplications":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/me/applications",
            "profilesChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/me/club/challenges",
            "profilesEntities":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/entities",
            "profilesExternal":"https://{env}public-ubiservices.ubi.com/{version}/profiles/external",
            "profilesInventory":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory",
            "profilesInventoryExpiredDetails":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory/expiredDetails",
            "profilesInventoryInstances":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory/instances",
            "profilesInventoryInstancesTransactions":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory/instances/transactions",
            "profilesInventoryPrimarystore":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory/primarystore",
            "profilesInventoryTransactions":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory/transactions",
            "profilesLeaderboard":"https://{env}public-ubiservices.ubi.com/{version}/profiles/ranks",
            "profilesMeBattlepassesSeasons":"https://{env}public-ubiservices.ubi.com/{version}/profiles/me/battlepasses/seasons",
            "profilesMeBattlepassesSeasonsSeasonId":"https://{env}public-ubiservices.ubi.com/{version}/profiles/me/battlepasses/seasons/{seasonId}",
            "profilesMeCommunityChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/me/club/communityChallenges",
            "profilesMeEvents":"https://{env}public-ubiservices.ubi.com/{version}/profiles/me/events",
            "profilesMeInventoryPrimarystore":"https://{env}public-ubiservices.ubi.com/{version}/profiles/me/inventory/primarystore",
            "profilesMeLeaderboard":"https://{env}public-ubiservices.ubi.com/{version}/profiles/me/ranks",
            "profilesMeRoamingProfiles":"{baseurl_msr}/{version}/users/me/roamingProfiles",
            "profilesNotifications":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/notifications",
            "profilesNotificationsBatch":"https://{env}public-ubiservices.ubi.com/{version}/profiles/notifications",
            "profilesProfileChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/me/club/playerchallenges",
            "profilesPreciseMatchmakingClient":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/matches/precise/clientstate",
            "profilesPreciseMatchmakingMatch":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/matches/precise/matchstate",
            "profilesRewards":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/club/rewards",
            "profilesSeasonChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/club/seasonchallenges?spaceId={spaceId}",
            "profilesStats":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/stats",
            "profilesStatsCard":"https://{env}public-ubiservices.ubi.com/{version}/profiles/statscard",
            "profilesUgcPhotos":"https://{env}public-ubiservices.ubi.com/{version}/profiles/ugc/photos",
            "profilesUgcPhotosOwn":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/photos",
            "profilesUgcViews":"https://{env}public-ubiservices.ubi.com/{version}/profiles/ugc/{contentId}/views",
            "profilesUgcFavorites":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/favorites",
            "profilesUgcRatings":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/ratings",
            "profilesUgcExternalVideos":"https://{env}public-ubiservices.ubi.com/{version}/profiles/ugc/externalvideos",
            "profilesUgcUpdateFavorite":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/{contentId}/favorites",
            "profilesUgcUpdateRating":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/{contentId}/ratings",
            "recommendations":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/recommendations",
            "remoteLogs":"https://{env}public-ubiservices.ubi.com/{version}/profiles/me/remotelog",
            "sandboxes":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/sandboxes",
            "secondaryStoreInventoryRulesExecution":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/inventory/rulesexecution",
            "spacesActions":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/actions",
            "spacesBattlepasses":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/battlepasses",
            "spacesBattlepassesSeasons":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/battlepasses/seasons",
            "spacesBattlepassesSeasonsSeasonId":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/battlepasses/seasons/{seasonId}",
            "spacesChallengepools":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/club/challengepools",
            "spacesChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/club/challenges",
            "spacesCommunityChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/club/communityChallenges",
            "spacesConfigsPrimarystore":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/primarystore",
            "spacesConfigsSsiAttributes":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/secondarystore/instances/attributes",
            "spacesConfigsSsiListsOfAttributes":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/secondarystore/instances/listsOfAttributes",
            "spacesConfigsSsiRules":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/secondarystore/instances/rules",
            "spacesConfigsUgc":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/ugc",
            "spacesEntities":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/entities",
            "spacesItems":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/items",
            "spacesLeaderboard":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/leaderboards",
            "spacesNews":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/news",
            "spacesOffers":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/offers",
            "spacesParameters":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/parameters",
            "spacesRewards":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/rewards",
            "spacesSeasonChallenges":"https://msr-{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/club/seasonchallenges",
            "spacesStats":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/communitystats",
            "spacesStatsCard":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/communitystatscard",
            "sessions":"https://{env}public-ubiservices.ubi.com/{version}/profiles/sessions",
            "telemetry":"https://receiver.telemetry-test.tgdp.ubisoft.org/telemetry",
            "users":"https://{env}public-ubiservices.ubi.com/{version}/users",
            "usersMeOnlineStatuses":"https://{env}public-ubiservices.ubi.com/{version}/users/me/onlineStatuses",
            "usersMeOnlineStatusesManualStatus":"https://{env}public-ubiservices.ubi.com/{version}/users/me/onlineStatuses/manualStatus",
            "usersOnlineStatuses":"https://{env}public-ubiservices.ubi.com/{version}/users/onlineStatuses",
            "tLog":"https://tglog.datamore.qq.com/{appId}/report/",
            "voicechatTokenVivox":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/voicechattoken/vivox",
            "voicechatConfigVivox":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/configs/voicechat/vivox",
            "websocketNotifications":"wss://{env}public-ws-ubiservices.ubi.com/{version}/websocket",
            "websocketServer":"wss://{env}public-ws-ubiservices.ubi.com",
            "profilesFriends":"https://msr-{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/friends",
            "calendar":"https://{env}public-ubiservices.ubi.com/{version}/spaces/{spaceId}/calendarentries",
            "profilesUgcReportContent":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/{contentId}/reports",
            "profilesUgcRequestReportedContent":"https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/ugc/reports"
         },
         "relatedPopulation":null
      }
   }
}

@sidelux
Copy link
Collaborator Author

sidelux commented Jul 8, 2021

@SwiftCODA thanks, i'll check it.

@SwiftCODA
Copy link
Contributor

@sidelux Have you looked into any of those endpoints or come across any new leads?

@sidelux
Copy link
Collaborator Author

sidelux commented Sep 12, 2021

Not yet i'm sorry, i will check it asap.

@SwiftCODA
Copy link
Contributor

SwiftCODA commented Nov 30, 2021

@sidelux @Seems2Legit. Someone found this thread and contacted me in an effort to help us figure it out. During that time, we discovered Map Stats. I also noticed that Ubisoft doesn't keep date-based information past July 31st (121 days before now). Through these discoveries, I've learned a bit more about Ubisoft's APIs. In one of my previous comments here, I showed a somewhat legible JavaScript API Request function. Here's what I know about it.

Method: GET
URL: https://r6s-stats-dev.ubisoft.com or https://public-ubiservices.ubi.com
Page: /v1/current/summary/{PROFILE_ID}

Parameters:
gameMode: pvp
platform: PC or PS4 or XONE
startDate: 20151126
endDate: 20211129 (today in YYYYMMDD)

Headers:
Ubi-AppId: 39baebad-39e5-4552-8c25-2c9b919064e2
Ubi-SessionId: YOUR_LOGIN_SESSION_ID
Expiration: YOUR_LOGIN_EXPIRATION
Authorization: Ubi_v1 t=YOUR_LOGIN_TICKET

I suggest using these headers in every request you try to examine. As for the parameters, those are common ones. If the URL does not directly require the userId, add the profileId as a parameter: profileIds= or populations= or profile_ids=

I believe the spaceId or spaceIds parameters are requiring the UUID for Rainbow. I have a value saved. It is either Rainbow for PS4 or Rainbow for PC, don't remember, sorry. 632df4a5-4fd7-4ee5-a0c8-1f221f7e585f
Screen Shot 2021-11-29 at 5 48 04 PM

Any of the endpoints in the list I previously sent that contain me in the title will not require any userId, profileId parameters, and instead require that the Authorization Token is that of the user in question. If the current match info endpoint we find ends up having a me in the title, the user will have to login with their own Ubisoft account.

If you guys have any connections with people that could help with this, I ask that you reach out to them. To be honest, I would pay good money for someone to find the endpoint and how it works.

Good luck.

@BadCoder1337
Copy link

I don't remember which thing came first TabLive or Official tracker update. But I assume the current match info might obtained through GraphQL API that harder to reverse-engeneer.

I've unraveled some endpoints (eg. inventory, chat), which had an official use, but I have no clue where ever to search the current match info endpoint. This info doesn't reveal explicitly to the user.

@SwiftCODA
Copy link
Contributor

@BadCoder1337 I'm pretty sure TabLive has been out for quite a while and the official Ubisoft stats tracker web page has been out for only a few months. I'm not familiar with GraphQL APIs but I think it would be weird for all of their endpoints to use the traditional method and have a couple using GraphQL. If that is the case, hopefully we can get yourself and anyone else you might know to help with it.

I have also unraveled some endpoints and have shared a few comments up in a JSON file. Each has a brief description of its purpose and the endpoint format. Problem is we can't see what parameters or headers are needed.

I noticed with TabLive that you have to 'link' your PSN, Xbox, Uplay accounts to see your in-game stats. So I'm wondering if there is 'current match information' for your PSN profile for example through Sony API. The way they get you to link it is weird to me because all you have to do is type your PSN username, but if you type a username that isn't yours, it won't work. So I don't understand how they're verifying your ownership of a PSN account.

@SwiftCODA
Copy link
Contributor

@BadCoder1337 Could you share some of the endpoints that you've found?

@danielwerg
Copy link

official Ubisoft stats tracker web page has been out for only a few months

Over a year

ref: danielwerg/r6api.js#42

@SwiftCODA
Copy link
Contributor

@danielwerg My bad. I Don't believe there's any relation between the TabLive feature and the official Ubisoft stats tracker anyway. One thing I wanted to mention to everyone, @BadCoder1337 @sidelux @Seems2Legit is this endpoint:

profilesPreciseMatchmakingMatch:
https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/matches/precise/matchstate

Based on my playing around with it, it looks to require the PUT method, instead of GET which makes me think maybe this is an endpoint that R6 uses to update the Ubisoft backend with match information while a player is playing. Maybe not though.

I believe the URL should look something like this:
https://public-ubiservices.ubi.com/v1/profiles/{profileId}/matches/precise/matchstate?platform=uplay/psn/xbl
https://public-ubiservices.ubi.com/v1/profiles/{profileId}/matches/precise/matchstate?platform=PC/PS4/XONE

The Host header is required for any JSON response. Method must be PUT otherwise you will get a 405 error.

With all that being said, here is the error I get:

{
    "moreInfo": "",
    "errorCode": 1,
    "httpCode": 400,
    "errorContext": "Shipyard.MMFrontEnd.Services",
    "message": "The body content is missing",
    "environment": "prod",
    "transactionTime": "2021-12-01T08:15:09.2371585Z",
    "transactionId": "fc2d8a4e-c964-49a5-8b9c-558351baef4e"
}

@BadCoder1337
Copy link

BadCoder1337 commented Dec 1, 2021

@BadCoder1337 Could you share some of the endpoints that you've found?

Ubisoft closed all inventory endpoints I discovered a year ago. Chat endpoint allows to send messages to any user ignoring friend list. In the wrong hands it could be easily abused and it will be shut down by Ubisoft.

Also I inspected official tracker again. GraphQL used for CMS purposes, so forget about it.

@SwiftCODA
Copy link
Contributor

@BadCoder1337 The list above that I found was sniffed through the Postman proxy while messing around with the Ubisoft Connect side menu in Siege for macOS. Maybe we can try analyzing requests made from Siege again, instead of just their webpage for stats.

@BadCoder1337
Copy link

@SwiftCODA It's easier to say than to do. The game and Ubisoft Connect use SSL pinning and do not lend themselves to my tools. For example, we can't unravel the WebSocket API.

@SwiftCODA
Copy link
Contributor

@BadCoder1337 What you said slightly goes beyond my scope of knowledge. I have used Postman, and their proxy to analyze network requests from Rainbow Six Siege in the past, which is where I found that big JSON file I posted earlier. Maybe what you're referring to cannot be done through my method though. If you know anyone with more expertise than us, you should get them to work on this. I will pay for someone to find this feature.

@SwiftCODA
Copy link
Contributor

@BadCoder1337 @sidelux @Seems2Legit @danielwerg I'm setting a $200 USD bounty on this. Anyone who finds the solution will get that through PayPal.

@SwiftCODA
Copy link
Contributor

I just noticed that on the bottom of the scoreboard in-game, there is a match ID. I expect we can make some request using this... Just a matter of finding the endpoint and how to get the match ID from a username.

@BadCoder1337
Copy link

@SwiftCODA obviuosly, match should be a some structure.
I tried following body:

{
    "spaceId":"632df4a5-4fd7-4ee5-a0c8-1f221f7e585f",
    "match":{
        "id": "01b4ba97-654e-4eb3-8211-85b1c628658a"
    }
}

Then I got the response:

{
    "moreInfo": "",
    "errorCode": 1013,
    "httpCode": 403,
    "errorContext": "Shipyard.MMFrontEnd.Services",
    "message": "The ticket application id is not the same as the header application id.",
    "environment": "prod",
    "transactionTime": "2022-04-26T09:52:23.3337302Z",
    "transactionId": "e381ddd4-b397-41cf-9576-865c1973a889"
}

I will try to get a proper auth ticket later.

@SwiftCODA
Copy link
Contributor

@BadCoder1337 With a valid app id and ticket:

{
    "moreInfo": "",
    "errorCode": 1000,
    "httpCode": 400,
    "errorContext": "Shipyard.MMFrontEnd.Services",
    "message": "Validation failed: \n -- IdempotencyId: idempotencyId is invalid or empty\n -- Match.GameMode: 'Game Mode' must not be empty.\n -- Match.MatchDetails: 'Match Details' must not be empty.\n -- Match.MatchDetails: 'Match Details' must not be empty.\n -- Match.Status: Invalid matchDetails.status value received. (only 'Fill' or 'Drain' are allowed as value)",
    "environment": "prod",
    "transactionTime": "2022-04-26T15:29:49.6702061Z",
    "transactionId": "dfbd2637-b171-4006-b28c-e5c34b91347e"
}

@SwiftCODA
Copy link
Contributor

@BadCoder1337 @sidelux @Seems2Legit @danielwerg

Bounty has been raised to $1000 USD. Share this around with any devs or reverse engineers you know.

@redraskal
Copy link

@danielwerg My bad. I Don't believe there's any relation between the TabLive feature and the official Ubisoft stats tracker anyway. One thing I wanted to mention to everyone, @BadCoder1337 @sidelux @Seems2Legit is this endpoint:

profilesPreciseMatchmakingMatch: https://{env}public-ubiservices.ubi.com/{version}/profiles/{profileId}/matches/precise/matchstate

Based on my playing around with it, it looks to require the PUT method, instead of GET which makes me think maybe this is an endpoint that R6 uses to update the Ubisoft backend with match information while a player is playing. Maybe not though.

I believe the URL should look something like this: https://public-ubiservices.ubi.com/v1/profiles/{profileId}/matches/precise/matchstate?platform=uplay/psn/xbl https://public-ubiservices.ubi.com/v1/profiles/{profileId}/matches/precise/matchstate?platform=PC/PS4/XONE

The Host header is required for any JSON response. Method must be PUT otherwise you will get a 405 error.

With all that being said, here is the error I get:

{
    "moreInfo": "",
    "errorCode": 1,
    "httpCode": 400,
    "errorContext": "Shipyard.MMFrontEnd.Services",
    "message": "The body content is missing",
    "environment": "prod",
    "transactionTime": "2021-12-01T08:15:09.2371585Z",
    "transactionId": "fc2d8a4e-c964-49a5-8b9c-558351baef4e"
}

This route would only update match info so you wouldn't find any info by definition. PUT is to update a resource, meaning the match has already started and you want to update the status. My guess would be this route updates Ubisoft Connect presence info to show if a player is in a match and what round, even though that feature is incredibly broken. I doubt any route for updating match state would be allowed client-side.

@Digneety
Copy link

I noticed you can now connect Discord to your Ubisoft account. It asks to update activity, so I watched the console and network logs of discord. It seems like it gets updated through a Websocket. Maybe we can figure out something through this.
image

@xorth
Copy link

xorth commented Apr 30, 2023

A discord websocket or a ubi websocket?

@Digneety
Copy link

Discord websocket

@SwiftCODA
Copy link
Contributor

I noticed you can now connect Discord to your Ubisoft account. It asks to update activity, so I watched the console and network logs of discord. It seems like it gets updated through a Websocket. Maybe we can figure out something through this.
image

I've wondered if there are more websockets like this because this has been a feature on consoles, and maybe the PC Ubisoft Connect app too (not sure on that one), where you can see for example "MY_FRIEND - Ranked - Round 4".

I am heavily under the impression that there is not an HTTPS endpoint for this information, and I think the process of obtaining it is not as direct as we think it might be.

Unrelated, kinda - but read:
There is a guy who created a third-party Valorant API. Valorant has official endpoints that return all sorts of stats, but they use profileIds, not usernames–and there is no way to obtain a profileId FROM a username...
So what he did was run an instance (or more) of the Riot client on remote Windows machine and somehow linked it to his API code.
How it works:
A user requests stats from his API via a username. It then passes the username to the Riot client, makes a friend request, where for whatever reason, the profileId is then exposed. It immediately unfriends the user and returns the profileId back to the API, and then uses that to proceed.

What I'm saying, is I think we need to look at this more abstractly. Looking into websockets or strange friend request methods of obtaining this information, stuff along those lines.

@Digneety
Copy link

Digneety commented May 4, 2023

I noticed you can now connect Discord to your Ubisoft account. It asks to update activity, so I watched the console and network logs of discord. It seems like it gets updated through a Websocket. Maybe we can figure out something through this.
image

I've wondered if there are more websockets like this because this has been a feature on consoles, and maybe the PC Ubisoft Connect app too (not sure on that one), where you can see for example "MY_FRIEND - Ranked - Round 4".

I am heavily under the impression that there is not an HTTPS endpoint for this information, and I think the process of obtaining it is not as direct as we think it might be.

Unrelated, kinda - but read: There is a guy who created a third-party Valorant API. Valorant has official endpoints that return all sorts of stats, but they use profileIds, not usernames–and there is no way to obtain a profileId FROM a username... So what he did was run an instance (or more) of the Riot client on remote Windows machine and somehow linked it to his API code. How it works: A user requests stats from his API via a username. It then passes the username to the Riot client, makes a friend request, where for whatever reason, the profileId is then exposed. It immediately unfriends the user and returns the profileId back to the API, and then uses that to proceed.

What I'm saying, is I think we need to look at this more abstractly. Looking into websockets or strange friend request methods of obtaining this information, stuff along those lines.

That's what I thought so I searched trough the Overwolf Overlay but even there the WebSocket is dead. There are some Http Request which are POST requests but nothing of value.

@Digneety
Copy link

Digneety commented May 5, 2023

So after deleting my earlier Post because I thought it was in the wrong place thanks to @SwiftCODA I decided to repost it because it might be helpful.

There is a narratives endpoint which shows you a recap of a match where you or a player performed very well. In the Response there are Informations like: Match-Id, Opponents, Teammates, match duration and the date when the match was played. So maybe there might be some more to this.
image

@SwiftCODA
Copy link
Contributor

Anyone familiar with the "groups from profileId" endpoint?
public-ubiservices.ubi.com/v1/profiles/{{PROFILE_ID}}/groups?{{SOME_PARAMETERS}}

Headers are:
Authorization: Ubi_v1 t={{MY_TOKEN}}
Ubi-AppId: {{MY_APP_ID}}
Ubi-SessionId: {{MY_SESSION_ID}}

Unsure of what the parameters are...
Screenshot 2023-05-08 at 12 46 49 PM
Screenshot 2023-05-08 at 12 46 59 PM

@Digneety
Copy link

Digneety commented May 8, 2023

So if you enter the parameters ?spaceId=0d2ae42d-4c27-4cb7-af6c-2099062302bb&groupTypeId=5c7dc274-10fc-4ce1-8342-455882d7a7cc you should get a response like this:
image

@zozo1237
Copy link

zozo1237 commented Nov 7, 2023

Also I inspected official tracker again. GraphQL used for CMS purposes, so forget about it.

Heads up for anyone still following this issue, there are (at least) two GraphQL endpoints:

  • The first is available at cms-cache.ubisoft.com is a Contentful CMS API and doesn't appear to be relevant here.
  • The other is available through the UbiServices Gateway at any UBI AWS endpoint (Ex. public-ubiservices.ubi.com) it can be accessed via POST /v1/profiles/me/uplay/graphql

The UbiServices endpoint seems to be running Apollo Server. Unfortunately introspection queries are disabled so we can't see the schema.

@zozo1237
Copy link

zozo1237 commented Nov 14, 2023

For future reference:

  • The API at public-ubiservices.ubi.com seems to be a no go with no relevant endpoints. Party management is done though this API, but matchmaking doesn't seem to be.
  • The relevant GraphQL API at /v1/profiles/me/uplay/graphql is also a no go - blind introspection revealed no relevant fields.
  • The WebSocket API at public-ws-ubiservices.ubi.com/v2/websocket isn't relevant either - none of the NotificationTypes I found relate to matchmaking.

All of the above seem to:
A: Have a lot of overlap with each other (You can get party management information from all of them) and,
B: Have a lot do do with the Ubisoft Connect Client

This leads me to the conclusion that matchmaking is done by a different server, likely one specific to R6. But because of the certificate pinning done by the R6 client I am unable to inspect the web traffic sent.

An cursory analysis of traffic sent from the client is as follows:

  • Connections to localhost on 1987, 2060, 2006, and 2001
  • Connections to many servers on 443
  • Connections to many, many servers on 3075
  • Other connections on 2012, 2015, and 2033

@hiibolt
Copy link

hiibolt commented Feb 28, 2024

@SwiftCODA Have you considered monitoring what Overwolf uses to keep tabs on current match?

I've written custom overlays for Overwolf, and it provides a ton of current match data. It's possible it doesn't directly read game data (otherwise, there'd probably be a lot of cheats patching Overwolf), and instead monitors some Ubisoft wss.

@SwiftCODA
Copy link
Contributor

@hiibolt Hey! No I haven't looked into it. I actually haven't touched much regarding this issue in a while because of trying to keep up with Ubi's new stats endpoints which are all over the place and have ridiculous rate limits. Fetching stats on a commercial level is not near is trivial as it used to be.

@hiibolt
Copy link

hiibolt commented Mar 6, 2024

@hiibolt Hey! No I haven't looked into it. I actually haven't touched much regarding this issue in a while because of trying to keep up with Ubi's new stats endpoints which are all over the place and have ridiculous rate limits. Fetching stats on a commercial level is not near is trivial as it used to be.

No kidding, never thought we'd have to implement a proxy and account rotator just to view some public numbers...

If you're still looking for endpoints, you can query the parameters with /v1/spaces/<spaceID>/parameters which displays a decent chunk of the usable endpoints and websockets.

@Digneety
Copy link

I know it's one endpoint for every ongoing match. And one for past matches to be used with matchIds. These are the only ones that would make sense.

Endpoints

{{ubiservices}}/v1/profiles/{{userId}}}/global/harboursocial/matchmaking
{{ubiservices}}/v1/spaces/{{spaceId}}/global/harboursocial/matchmaking

Possible SpaceIds

30d7588c-820d-4f76-8eed-20ca8df34401 - Rainbow Six Online Service

0d2ae42d-4c27-4cb7-af6c-2099062302bb - Rainbow Six Crossplay

809b633b-52b4-4c77-9b3c-34949e1ae8f4 - Harbour

c0282fd8-a9dc-4943-81b2-72d6afd336f9 - Harbour Calypso Services

2d2f687d-cf94-4757-9157-b8736284c438 - Harbour Account Players Privileges Api Component

Possible Parameters

?matchIds={matchIds}

?matchmakingType={matchmakingType}

?matchType={matchmakingType}

?matchIds={matchIds}

?spaceIds={spaceIds}

Match Types

PVE_MAPRUN_PARTY

MATCHMAKING_PVE_BOTS_PARTY

MATCHMAKING_PVE_BOTS_MM

MATCHMAKING_PVP_ARCADE

MATCHMAKING_PVP

Headers

Authorization: Ubi_v1 t={{access_token}}

Ubi-AppId: {{appId}}

Ubi-SessionId: {{sessionId}}

Information

  • Currently 404 but I suspect it's because of the wrong usage of parameters or something. The DataDev endpoint shows similar behaviour if the endpoint is not used correctly it will return 404, but with the correct usage returns a response.

@omiplaygame
Copy link

Does anyone know where the endpoint of the games list is?

There is one url to get games "https://public-ubiservices.ubi.com/v1/profiles/me/uplay/graphql" if you only know "spaceIds" but where can you get its own spaceIds?

@Digneety
Copy link

What?

@CNDRD
Copy link

CNDRD commented May 29, 2024

@omiplaygame
Curious where you saw Ubi use the graphql for 'games list'?
As far as i know they only use it for the marketplace 🤔


Also while I'm here i gotta tell yall .. You're far far away from the correct endpoints..
However I cannot reveal those endpoints publicly here 😞

But harboursocial is definitely not the way lol 🫡

@omiplaygame
Copy link

@CNDRD
Such requests were in the ubisoft connect launcher
The request "post" is sent
Example: '{"operationName":"GetOwnedGames","variables":{"spaceIds":[]...'

In the response, we have all the games on the account, name, platform, LastPlayedDate, and more..
But I just started researching, maybe there are other ways if you have any, please share?)

@Digneety
Copy link

You want to get the Name for the corresponding spaceId?

@omiplaygame
Copy link

Yes, I can get all the games through this link

https://avcvysejs1-dsn.algolia.net/1/indexes/products_en-us_default?&query=&hitsPerPage=1000&attributesToRetrieve=title,intlName,availabilities,spaceId

But so far I can’t find a query that returns all spaceIds in my account for GetOwnedGames

@Digneety
Copy link

Digneety commented May 29, 2024

{{ubiservices}}/v1/spaces/global/ubiconnect/games/api/catalog?spaceIds={{spaceIds}} for the names of the applications

@Digneety
Copy link

And this one for the games: {{ubiservices}}/v1/profiles/{{profileId}}/gamesplayed

@omiplaygame
Copy link

omiplaygame commented May 30, 2024

@Digneety
Yes, thanks, this is another way to get a list of games if you know spaceids

Where can I find these spaceids, so that I can then execute the request and get the names of the games?

...
Looks like I found
/v1/profiles/me/global/ubiconnect/entitlement/api/entitlements

Strange, last time I got http code 304, now everything is fine

@ubiservices
Copy link

@omiplaygame

Where can I find these spaceids, so that I can then execute the request and get the names of the games?

You won't get private spaceId's, no one will share them to you.
However, public spaceId's can be found here: v1/spaces/global/ubiconnect/games/api?limit=10000

as for the subject on this thread, you wont find live match information.
its mostly stripped anyway.

@omiplaygame
Copy link

@ubiservices
Got it, thanks for the link and for explaining it in more detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests