Trello API not recognizing my board ID (no errors)

This is the new thing I added

function getAddon()
	if token~="" then
		addon="?key="..key.."&token="..token
	elseif getfenv(0).token~=nil then
		local val=getfenv(0).token
		addon="?key="..key.."&token="..val
	else
		error([[-Instructions.
	  1. Go to this link and click allow: https://trello.com/1/authorize?key=[Your api key is at https://trello.com/app-key]&name=Roblox+Api&expiration=never&response_type=token&scope=read,write	
	  2. Copy the token in the page sent to you
	  3. Paste the token in the Value of Token]])
	end
	return addon--"&key="..key.."&token="..token
end 

print “boardID” (the variable not a string) in the main script and tell me if it returns anything.

Like this?

print(board)
print(list)
local boardID = api:GetBoardID(board)
print(boardID)

That’s not gonna do anything, because the script does NOTHING after it gets the variable. Yes, I’ve tried it.

Thats why I want to know if it returns the board ID, print it and tell me whether it says nil or not. so I can identify whether it is the board ID function or the other functions. so print the board id variable

So you’re asking for this part?

local board = "Fortress"
local list = "Generals"

local api = require(game.ServerScriptService:WaitForChild("APIs").TrelloAPI)
print("api")

print(board)
print(list)
local boardID = api:GetBoardID(board)
print(boardID)
print("board")
local listID = api:GetListID(list,boardID)
print("variables")

local newCard = api:AddCard("Test","Test123",listID)
print("card")

It doesn’t print anything lol, that’s the entire point of this post, to find out why it’s not saying why.

put the print(dt) in and tell me what it says. This is working perfectly fine for me so this is probably due to you not putting in the key or not putting in either the key/token correctly

function T:GetBoardID(name)
			local url
			if Private then
				getAddon()
				url="https://api.trello.com/1/members/me/boards"..addon
			else
				getAddon()
				url="https://api.trello.com/1/members/me/boards"..addon
			end
			local tball=HS:GetAsync(url,true)
			local dt=HS:JSONDecode(tball)
			print(dt)
			for _,tab in pairs(dt) do
				for p,it in pairs(tab) do
					if p=="name" and it==name then
						return tab.id
					end
				end
			end
			error(name.." not found!")
			return nil
		end

Interesting, I started over COMPLETELY, and it worked, must have been something wrong on my half.

1 Like