Open BinarMorker opened 6 years ago
In game the #nnnnn does not show up. Since that is the destiny game account and not the blizzard account (though it is a destiny platform specific account) you want to pull from the bungieNetUserInfo section because that is the account that is authorized via the OAuth endpoint and thusly ties back to the blizzard servers. The displayName you see in the destinyUserInfo is the account and platform played within the game. This is the same for psn and Xbox. I have clan members that have different Xbox names than their bungie net account and destiny user info names.
I understand that. However, if I have no bungieNetUserInfo linked to my Destiny profile, how can I get the full Battle.net gamertag?
You can't. It used to be you can run getAccount but that endpoint is now retired and because that data falls under privacy settings, it's protected. If your app has OAuth, you can use the getCurrentAccount to pull the protected data or you can run clan data vs bungieNet User Searches to "infer" the account. You can check the privacy settings for the account in the profile section:
{
"Response": {
"profile": {
"data": {
"userInfo": {
"membershipType": 1,
"membershipId": "4611686018441329538",
"displayName": "NinerOneThree"
},
"dateLastPlayed": "2018-07-28T17:20:55Z",
"versionsOwned": 7,
"characterIds": [
"2305843009267621982",
"2305843009267621983",
"2305843009267621984"
]
},
"privacy": 1
},
"privacy": 1 See here for the possible values: https://bungie-net.github.io/multi/schema_Components-ComponentPrivacySetting.html#schema_Components-ComponentPrivacySetting
My app does not have OAuth, but I remember being able to get the full Battle.net displayName in the UserCards in the past. There must be an update in the API that made this behavior change.
Thanks anyway!
Many changes - the link I gave you is the git hub maintained by bungie. you can check all of the stuff there and review the change logs. They swagger the API so all docs are autogenerated.
Yes I know, I looked there first. I was just wondering if there was some kind of obscure parameter that made it appear, somewhere like in the supplementalDisplayName field or something (what does this field do anyway). There were many undocumented features back in Destiny 1, so I figured I'd ask :)
Calling this endpoint
https://www.bungie.net/Platform/User/GetMembershipsById/{membershipId}/{membershipType}/
gives me the information I need, but only in the GeneralUser entity, not in the UserInfoCard. Since not every player has a GeneralUser entity linked to their Destiny account, it seems that there is no other way to get their correct displayName. For example, here is my date fetched from the API:Is this a bug or an oversight? It seems I should be able to access this data normally like for PSN and Xbox accounts, but the Battle.net handle is wrong here. Thanks for your time.