TrackerNetwork / TRN.Developers

Information and Issue Tracker for the Tracker Network API.
https://tracker.gg/developers
24 stars 5 forks source link

OverWatch API-BattleNet not working #8

Closed Austinmoore1492 closed 5 years ago

Austinmoore1492 commented 5 years ago

Everything else is working fine (Xbox and PlayStation) but I cannot load any profiles that have battlenet accounts.

lwansbrough commented 5 years ago

Hey, thanks for reporting. Can you provide the account that doesn't work? A number of accounts that I tested appear to work fine.

Austinmoore1492 commented 5 years ago

DoctorWhat#11993, then i tried a few of https://overwatchtracker.com/

Austinmoore1492 commented 5 years ago

I'm pretty sure it has something to do with the # in the BattleNet ID. Just having looked at the console when I fetch a BattleNet Profile it excludes the #. So if i look for DoctorWhat#11993 it is only fetching the DoctorWhat potion. I figured since it was working on other platforms it was something I had done.

lwansbrough commented 5 years ago

You have to URL encode the name before you append it to the API URL. # should become %23

amosda4183 commented 5 years ago

I am having this issue as well. In my own application as well the documentations 'try it out' drawer. PSN and Xbox Live are working fine, but there is no response to a request for the Battlenet platform, after attempting multiple user accounts. I also attempted the request using the URL encoding you mentioned in a previous comment and could not get anything back.

Austinmoore1492 commented 5 years ago

Do you happen to have a link to the code and did you use encodeURI or encodeURIComponent?

amosda4183 commented 5 years ago

When I click the 'Make Request' Button here, nothing happens, though you can see in the GET request that the URL is properly encoded before being sent. When the button is clicked with the default input, or any other input, nothing happens.

tracker-network tracker-network-2

amosda4183 commented 5 years ago

Below is the code from my local environment. Using encodeURIComponent I can see that the platformId is properly encoded and attached to the request that is sent, but it returns an empty object. So I'm not sure what the issue could be. The PSN and Xbox Live requests are working fine, there only seems to be an issue with Battlenet. tracker-network-3 tracker-network-4

Austinmoore1492 commented 5 years ago

I still hve the same issue. On mine I can search for profiles from the overwatch tracker network but I cannot find my own profile. Not sure what the issue is there.

lwansbrough commented 5 years ago

@amosda4183 You exposed your API key publicly, you should create a new application. This key is private. The user Kabaji#21523 has a private profile. You should be receiving a 451 response from our server (indicating the profile is private -- we also provide an error message as JSON in the response.) Check the network requests tab.

lwansbrough commented 5 years ago

@Austinmoore1492 Use encodeURIComponent

Austinmoore1492 commented 5 years ago

I have used it, I can pull data for some battlenet ids just not mine.

Austinmoore1492 commented 5 years ago

Which I assume is because the profile is private, as you stated.