Hi guys,
Can someone please give me an example of how to access the Halo: Reach stats API
using jquery ajax?
Here is an exert:
GetGameHistory(System.String, System.String, System.String, System.String)
This function is used to browse through a player's history of games.
Parameters
identifier: Your application's identifier string. gamertag: The target player's gamertag. variant_class: The variant class of game to get. Valid values are "Campaign", > "Firefight", "Competitive", "Arena", "Invasion", "Custom". Pass "Unknown" to get all games. iPage: The page of results you want, starting at page 0.
Return Value A GameHistoryResponse object containing a list of the games matching the criteria you specified.
Example http://www.bungie.net/api/reach/reachapijson.svc /player/gamehistory/ {identifier}/{gamertag}/{variant_class_string}/{iPage}
here was my attempt:
var apikey = 'xxx';
var gamertag = 'The Hailwood';
var variant = 'Competitive';
var page = '0';
var url = 'http://www.bungie.net/api/reach/reachapijson.svc/player/gamehistory/'+apikey+'/'+gamertag+'/'+variant+'/'+page;
$(document).ready(function() {
$.ajax({
url: url,
success: function(data) {
$('#return').html(data);
}
});
});
However I get XMLHttpRequest cannot load http://www.bungie.net/api/reach/reachapijson.svc/player/gamehistory/xxx/The%20Hailwood/Competitive/0. Origin http://localhost is not allowed by Access-Control-Allow-Origin.
What does this mean?
Update:
Ok so I fixed it by setting appropriate permissions.
But now I am getting a 400 response from the server.
Any idea what would cause this?
Update2:
API IS NOT OPERATIONAL! hence why it is not working :(