I'm trying to get the Player's Name on steam trought their SteamID64 and "response" is returning nil.
[CODE]function GetPlyInfo(steamid64, funct)
if (APIKey == "") then return 0 end
local url = string.format("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s&steamids=%s", tostring(APIKey), tostring(steamid64))
local success = function(body, len, headers, code)
local json = (body and util.JSONToTable(tostring(body)) or {})
if(funct) then
local tbl = (json.response.players and json.response.players[1] or {})
funct(tbl)
end
end
local failure = function(err)
if(funct) then
funct({})
end
end
http.Fetch(url, success, failure)
end[/CODE]
APIKey is correct and I'm not figuring out what is causing this error... any ideas?
Thanks in Advance.
Have you tried...
... Printing the body without converting to JSON and seeing what the actual response is?
[CODE]<html><head><title>Forbidden</title></head><body><h1>Forbidden</h1>Access is denied. Retrying will not help. Please verify your <pre>key=</pre> parameter.</body></html>[/CODE]
:dance:
You also appeared to have forgotten to specify the output as JSON.
Most likely your key is incorrect or you are formatting it wrong.
[QUOTE=MrGeekabit;52353491]Most likely your key is incorrect or you are formatting it wrong.[/QUOTE]
I found out right after Robotboy655's post...
It was a bad format.
Thanks for the help
Sorry, you need to Log In to post a reply to this thread.