After successfully retrieving data from the Bungie API previously, I am now facing a challenge in reading a specific JSON file. http://prntscr.com/k3tin3
I'm currently stuck on how to extract a node from the JSON and then utilize it to request character data.
Despite my best efforts, the code snippet below does not seem to work as intended. What could be causing the issue? :/
$.ajax({
url: "https://www.bungie.net/Platform/Destiny2/4/Profile/" + searchField + "/?components=100,200",
headers: {
"X-API-Key": apiKey
}
}).done(function(json){
if(JSON.stringify(json.Response.profile.data.characterIds[0])){
var char_slot_0 = JSON.stringify(json.Response.profile.data.characterIds[0]).replace(/[\"\"]/g, "");
var char_slot_0_class = JSON.stringify(json.Response.characters.data.+ char_slot_0 +.classType);
}
});
While fetching characterIds functions correctly, the extraction of the second line poses a challenge. Should I consider making a separate call instead of combining them in one?
Edit: To incorporate the result variable char_slot_0 (which returns: 2305843009303234831) as a node in the new JSON stringify request is my current objective.