Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get card names from Trello via HttpService?

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)

1 comment

1

You shouldn't post private keys on forums! You should get a new key before someone uses it for evil.

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.