Having trouble with JavaScript requests and CORS in browsers?
Fear no more, simply replace http://www.bungie.net/platform with http://bungie-platform.herokuapp.com/proxy.
The API Proxy works on node and simply proxies your request to the bungie.net/platform while removing the CORS headers. It also forwards cookies (hooray!).
[b]API Explorer[/b]
If you want to simply look what is available for API Endpoints you don't have to write your own client. I tried parsing the endpoints file and with a bit of code the API Explorer was alive: http://bungie-platform.herokuapp.com/api/explorer. I still need to map out some things so one knows what to actually put into the generated fields BUT right now I think it already works pretty well.
Cheers and have fun o/
Sargo
Hey, I was wondering if you could give me a hand with this. I'm trying to use the herokuapp to overcome the CORS issue, but I'm getting the following message:
[quote]XMLHttpRequest cannot load http://bungie-platform.herokuapp.com/proxy/User/SearchUsers/?q=FraserBaws. Request header field X-API-Key is not allowed by Access-Control-Allow-Headers in preflight response.[/quote]
I'm using the following jQuery AJAX call:
[quote] $.ajax({
type: 'GET',
beforeSend: function (request) {
request.setRequestHeader("X-API-Key", apiKey);
},
url: 'http://bungie-platform.herokuapp.com/proxy/User/SearchUsers/?q=FraserBaws',
success: function( data ) {
response(data.Response);
}
});[/quote]
Any idea why I may be getting this message? Any help is greatly appreciated.
Hey Sargo,
Thanks for your API documentation. I've a few questions, I can get user info with a gamertag/psn, with that info I can get membershipid, charactersid. But on http://bungie-platform.herokuapp.com/api/ I see parameter letters everywhere which I dont know where to replace them with.
I noticed d should be console, and e gamertag/psn. Do you have more info about the parameters?
I'm working on a call that can check players K/D ratio, do you know have any idea which call I'll need for that?
Thanks in advance.
xgerhard