Trello API 404 (Not Found)

For some reason, I get a 404 error when I followed the API Instructions!

function TrelloAPI:RemoveList(listid)
	local addon = getAddon()
	if addon == nil then
		error('Invalid Arguments!')
		return nil
	else
		local data = {id=listid}
		local EncodedData = HTTPService:JSONEncode(data)
		HTTPService:PostAsync("https://api.trello.com/1/lists/"..listid.."/closed"..addon, EncodedData)
	end
end

Screen Shot 2020-07-15 at 9.37.57 am

Note: It’s in a ModuleScript.

Documentation:
https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-closed-put

That probably means your list id isn’t valid, so it can’t find that list.

2 Likes

It’s a PUT request, not a POST one.
image

Instead, use RequestAsync:

HttpService:RequestAsync(
		{
			Url = "https://api.trello.com/1/lists/"..listid.."/closed"..addon,
			Method = "PUT",
			Body = EncodedData
		}
	)

If it still doesn’t work, let us know.

1 Like

Sorry for the late response!

Now, I get the error, 20:54:54.902 - HttpError: Aborted

Edit: I found the problem. I didn’t put all caps for PUT but, now nothing happens. No errors.

1 Like

Nevermind! I found it out. I had to add &value=true to the end of the link.

1 Like