Trello API Issue

I am having an issue where the system is not checking whether or not they have a card in pending or not. I am 100% sure that this is not an API issue as HttpService is successfully getting all of the cards in the list. I have also tried using string.match and tostring(), and that hasn’t worked either.

Client-Side Code

--plr is the localplayer
if game.ReplicatedStorage.Check:InvokeServer(plr) == true then
			script.Parent.p1.check.Text = "Error: You have already applied."
			return 
			else
--other code down here (yes i closed it properly)

Server-Side Code

game.ReplicatedStorage.Check.OnServerInvoke = function(plr)
	print(plr.Name)
	local get = http:GetAsync('https://api.trello.com/1/boards/'..module.Trello..'/lists?key='..module.Key..'&token='..module.Token,true)
	local tab=http:JSONDecode(get)		
	for _,v in pairs(tab) do
		if v.name:match('^Pending%s?$') then
			boardid = v.id
			local musget = http:GetAsync('https://api.trello.com/1/lists/'..v.id..'/cards?key='..module.Key..'&token='..module.Token,true)
			local mustab = http:JSONDecode(musget)
				for _,m in pairs(mustab) do
					print(m.name)
					if tostring(m.name) == plr.Name then
						print("1")
						return true
				end
				print("2")
				return false
				
			end	
		end
	end
end

Output:
image

1 Like

Have you read/tried this method? Roblox-trello | Object Oriented Trello API

I was struggling to script TrelloAPI like you did until I read that method, it really helped me a lot.

1 Like

Yes, I have used and am currently using that API for a different purpose, but in the current V1 version I don’t think that there’s a function I could use that would work properly.

I’m not a really expert at scripting. What about you try GetCard() or GetList()? I’m pretty sure these functions will allow the script to track an user to see if their app is now pending in the system.

Just to confirm, there is a card in the “Pending” list named “SS4PPHIRE”? A screenshot of the Trello board may help us understand.

Correct.

I also know that it IS getting the cards from the list, as I had it print the value from the loop in output.image

I spotted the issue. You have the return false within the for _,m in pairs(mustab) do so you are returning false before reaching “SS4PPHIRE”. Simply move the return false to after the end of the loop. Something like this:

for _,m in pairs(mustab) do
    print(m.name)
    if tostring(m.name) == plr.Name then
	print("1")
	return true
    end
    print("2")
end	
return false
1 Like

Do be aware that this may not work if you end up having more than 10 lists.
Trello has imposed a rate limit reduction on requests originating from Roblox, reducing it to a mere 10% of what is listed on their documentation.

(10 requests per 10 seconds per token)
(30 requests per 10 seconds per api key)