Attempt to edit Trello cards

I am attempting to edit cards in trello using the PUT method in HttpService.

However at the same line as:
I get an error “Unable to cast to value”.

        if string.lower( == string.lower(User.Name) then
			print("Player is on list.")
			OnList = true
			local PlayerName = User.Name
			local Description = "KNOWN MEMBER"
			local List = "5feadac75471a94a8c4f50a4"
			local CardId =
			local data = {id = CardId, name = PlayerName, desc = Description}
			local EncodedData = HttpService:JSONEncode(data)
			local Return = HttpService:RequestAsync({ 
				Url = ""..CardId..Tokey,
				Method = "PUT",
				Body = EncodedData
			local ReturnDecoded = HttpService:JSONDecode(Return)

I’ve been stuck on this for basically the entire day.

Thank you in advance.

The return value of HttpService:RequestAsync is a table of information about the request, so you would do Return.Body.


I never really have had experience using RequestAsync nor Trello but I’m pretty sure your URL requires a query such as “cards/CardId?key=”. But without seeing the “Tokey” value I don’t know if you have already provided that.

Here’s an example: “

You can also use a Trello module, just search for it in the devforum. That handles all the backend for you, so you don’t have to think about that.
If you want to do it yourself, you can also take a look at the module, and implent it in your own code.

@sjr04 Your method did fix the error that was coming up, but the expected result seems to still not occur. The goal I had was for the code to edit the card but it seems that even without the error it failed to edit the card. The expected result was “KNOWN MEMBER” in the card’s description but the card stayed the same.

  • To clarify this is the change I made with your assistance (just incase I did something wrong).
    local ReturnDecoded = HttpService:JSONDecode(Return.Body)

What printed out was a table and I went through that table and got this:

Also thank you very much for the help so far.

@alphajpeg I made sure the key and token were correct by testing the “DELETE” method. Thank you though.

@Boele009 I want to do it myself but I have attempted to search up previous modules to use as an example and a lot of the information I got was from those modules but I did not come across a module that allowed editing a card in trello.

If none of the modules here on the devforum, I think the Trello API doesn’t have an endpoint for it, so it probably isn’t possible.

It does according to:

There is also a list someone made to what functions they want added to their trello module but “update card” is one of the unfinished ones.

Jakey assisted me with the code, he found that to edit it requires changing the URL as well:

Url = ““..CardId..Tokey..”&desc=”…Description,