Long story short, I'm making a profile "viewer" for fun using the Bungie.net API and all of the JSON data I decode is returning nil. I'll show you the JSON String I receive, as well as the code I am using to decode it into a table.
JSON String Returned:
{"Response":[{"iconPath":"/img/theme/destiny/icons/icon_psn.png",
"membershipType":2,"membershipId":"4611686018433631548",
"displayName":"xNirdx"}],"ErrorCode":1,
"ThrottleSeconds":0,"ErrorStatus":"Success",
"Message":"Ok","MessageData":{}}
My Code (In a ModuelScript):
-- bungie's servers reject any requests without an api key, just a warning in case you try to test this
httpService = game:GetService("HttpService");
headers = {
["X-API-Key"] = "a1b2c3d4e5f6g7h8i9j" -- replaced, not supposed to share it publicly
};
function searchPlayer(username)
local searchResult = httpService:GetAsync(
"http://www.bungie.net/Platform/Destiny/SearchDestinyPlayer/" .. "TigerPsn/" .. username .. "/",
true,
headers
);
local decodeResults = httpService:JSONDecode(searchResult);
print(decodeResults.Response.iconPath);
end
return searchPlayer;
Output:
nil
I'm absolutely stumped, and I'm sure there's a simple solution and I'm just overthinking it. Any help would be appreciated, and if more info is needed I'm happy to give it.

1 comment
I knew I just needed some sleep, lol. I'll try this after school, thank you!!