"Can't parse JSON" error with :JSONDecode() function

I am trying to decode the function “t” but I came across an error called as “Can’t parse JSON” from line 8.

local BoardID = “MH74yM0f”
local t = HttpService:GetAsync(“https://api.trello.com/1/boards/"..BoardID.."/lists”)
local as = HttpService:JSONDecode(t)
local Info = {}

I’ve not update this script for months now since October 2018 and I require help on this.

That means the response of the request isn’t in JSON format. Try printing the response to see what its saying. Doing the following works. So the issue is that the request isn’t returning correctly. When I attempt to run your script I get error ‘401’ which means unauthorized. It is possible that Trello doesn’t allow for requests from Roblox.

game:GetService('HttpService'):JSONDecode('[{"id":"5ae7194d8a0d67dbb4fc252d","name":"Info","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":32767.5,"subscribed":null,"softLimit":null},{"id":"5ae714312a00d93245c4d60f","name":"Flight Number","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":65535,"subscribed":null,"softLimit":null},{"id":"5b07726c9a52dac76ac0094e","name":"Gate","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":98303,"subscribed":null,"softLimit":null},{"id":"5ae718ebb8bc7e241f0a5a79","name":"Destination","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":131071,"subscribed":null,"softLimit":null},{"id":"5ae718f8fb5e5bc812f44681","name":"Aircraft","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":196607,"subscribed":null,"softLimit":null},{"id":"5ae718fb2fe57aac26ed6526","name":"Miles","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":262143,"subscribed":null,"softLimit":null},{"id":"5ae71a22fb88f9c266aea94d","name":"Host","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":327679,"subscribed":null,"softLimit":null},{"id":"5b4b04f0bbff43dfc7192d13","name":"Airport","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":393215,"subscribed":null,"softLimit":null},{"id":"5b4b05ebd509d51b19ff4079","name":"Check-In Time","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":458751,"subscribed":null,"softLimit":null},{"id":"5b4b05eedb66bf2d14af7244","name":"Boarding Time","closed":false,"idBoard":"5ae714245c089088b8721fce","pos":524287,"subscribed":null,"softLimit":null}]')

You need an API key and token to use /boards/{id}/lists. You can get your API key at https://trello.com/app-key, and there should be instructions there on how to get your token as well.

1 Like