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

[Question] How to use SearchDestinyPlayer for PC? #258

Closed
jgayfer opened this issue Oct 24, 2017 · 9 comments
Closed

[Question] How to use SearchDestinyPlayer for PC? #258

jgayfer opened this issue Oct 24, 2017 · 9 comments

Comments

@jgayfer
Copy link

jgayfer commented Oct 24, 2017

I've been trying to retrieve Battle.net accounts, but have been unsuccessful. This is the endpoint I'm hitting.

https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayer/4/Asal#1502

Where Asal#1502 is my Battle.net ID

@floatingatoll
Copy link

floatingatoll commented Oct 24, 2017 via email

@jgayfer
Copy link
Author

jgayfer commented Oct 24, 2017

Perfect, thank you!

@abcpremium
Copy link

I have the same problem and encoding the '#' to '%23' doesn't work either. I always get an HTTP error 400 - Bad request. Is there anything else I need to watch out for? The X-API-Key header is set of course. So far, the only API endpoint I can use is "User.GetBungieNetUserById". Every other endpoint throws errors etc.

@ckhicks
Copy link

ckhicks commented Sep 5, 2018

Sounds like it may be a different issue than OP had, but if you can post a sample of your code then the hive mind may be able to assist!

@abcpremium
Copy link

Sure, thank you. Well the only request I can make is: https://www.bungie.net/Platform/User/GetBungieNetUserById/MY_USER_ID/. With the X-API-Key set I get a result like the following:

{
	"Response": {
		"membershipId": "MY_MEMBERSHIP_ID",
		"uniqueName": "MY_UNIQUE_NAME",
		"displayName": "hallleron",
		"profilePicture": 70710,
		"profileTheme": 0,
		"userTitle": 0,
		"successMessageFlags": "0",
		"isDeleted": false,
		"about": "",
		"firstAccess": "2017-10-31T17:06:24.06Z",
		"lastUpdate": "2018-09-05T13:33:24.711Z",
		"showActivity": true,
		"locale": "de",
		"localeInheritDefault": false,
		"showGroupMessaging": true,
		"profilePicturePath": "/img/profile/avatars/cc00008.jpg",
		"profileThemeName": "d2cover",
		"userTitleDisplay": "Newbie",
		"statusText": "",
		"statusDate": "0001-01-01T00:00:00Z",
		"blizzardDisplayName": "MY_BLIZZARD_DISPLAY_NAME"
	},
	"ErrorCode": 1,
	"ThrottleSeconds": 0,
	"ErrorStatus": "Success",
	"Message": "Ok",
	"MessageData": {}
}

I play on PC, so that should be the MemberShipType 4. But I for example call:
https://www.bungie.net/Platform/Destiny2/4/Profile/MY_MEMBERSHIP_ID/ I get the following response:

{
	"ErrorCode": 18,
	"ThrottleSeconds": 0,
	"ErrorStatus": "InvalidParameters",
	"Message": "The input parameters were invalid, please enter valid input, and try again.",
	"MessageData": {}
}

I also tried replacing the MemberShipId in the URL with my Blizzard Display Name ('#' encoded) and still nothing.

If I perform a search via https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayer/-1/MY_USERNAME/ I get one result which is an account for XBOX (not me) and that's it. I don't even get listed in the search results. Is there something wrong when the person is playing on PC?

@ckhicks
Copy link

ckhicks commented Sep 5, 2018

Ah, if you're trying to use your Bungie membershipId from that request vs your destinyMembershipId, then you'll hit issues when trying to get more than general account data. You might be looking for the information supplied via: https://bungie-net.github.io/#User.GetMembershipDataById

@jamieastley
Copy link

@abcpremium be sure to provide a component type

(eg. .../Profile/{membershipId}?components=100)

query along with that request, not providing one will return an invalidParameters error like you posted

@abcpremium
Copy link

Thank you, I finally found a way. I can't search for my battle.net account, however I can extract my membershipId on the bungie website through a link on my profile page. Weird though that you can't search for players with a battle.net id.

@ghost
Copy link

ghost commented Dec 8, 2018

I agree with @abcpremium we should be able to search no matter what kind of membership type the player has. Even using membership type -1 ("all") only returns my XBL account. I can't search for my pc account.

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

5 participants