Alright, so I am attempting to retrieve the names of cards under a certain list of a Trello board. I am then taking the data I receive from Trello and inserting it into a TextLabel. Below is the code I have, I understand PostAsync and the usage of JSONEncode. However, I am lost with JSONDecode..
function GetTrelloData() local data = game:service'HttpService':GetAsync("https://api.trello.com/1/lists/54e7d14c6e58dc8e8fa5dad7/cards?key=6207b69cb6d65e98733481c3edbcf251",game.HttpService:JSONDecode({"true"})) wait(1) script.Parent.Parent.TextLabel.Text = data end script.Parent.MouseButton1Click:connect(GetTrelloData)
The second parameter to GetAsync() is 'nocache'. nocache means if you want what you got to be saved and reused, or if each time you look for that value, it'll use :GetAsync() again
Try the following: Also, I put game:GetService() at the top to neaten things up. What you had was fine however.
http = game:GetService("HttpService") function GetTrelloData() local data = http:GetAsync("https://api.trello.com/1/lists/54e7d14c6e58dc8e8fa5dad7/cards?key=6207b69cb6d65e98733481c3edbcf251",true) local response = data and http:JSONDecode(data) or 'Failed To Return' print(response) end
Check if the above prints anything. If it does, then just replace
print(response)
with
script.Parent.Parent.TextLabel.Text = data