Trello/API 401 Error

For some reason, I’m trying to use the Trello API but I keep getting this error.

18:39:11.475 - HTTP 401 (Unauthorized)

How do I fix this?

local TrelloAPI = {}
local HTTPService = game:GetService("HttpService")

function TrelloAPI:GetBoard(boardId)
	local JSON = HTTPService:GetAsync("https://api.trello.com/1/boards/"..boardId)
	local DecodedData = HTTPService:JSONDecode(JSON)
	return DecodedData.name
end

return TrelloAPI

You need to generate a Trello API key & token to use the API.
Therefore, your URL would be (once you’ve got the API key & token):
https://api.trello.com/1/boards/boardIDHere?key=APIKeyHere&token=TokenHere

1 Like