> For the complete documentation index, see [llms.txt](https://inceptionstrange.gitbook.io/trelloapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inceptionstrange.gitbook.io/trelloapi/documentation-en/api-startup-and-documentation/cards-api.md).

# Cards API

This page describes all the functions concerning the Cards on Trello.

**How can I access the functions of this category?**

**\[ 1 ] -** Open a ServerScript\
**\[ 2 ] -** Look at the following script.\
(Example script to understand how to access a category and to a function)

```lua
-- // Require TrelloAPI Module
local TrelloAPI = require(game.ServerScriptService:WaitForChild("TrelloAPI"))

-- // Access to the category
TrelloAPI.CardsAPI.[FunctionName]
```

### CreateCar&#x64;**(**&#x4E;ame, ListId, BoardOptionalDat&#x61;**)** <a href="#getboardid" id="getboardid"></a>

Create a Card in Specific List , Return `true` if the function is successful `false` if the function fail.

```lua
TrelloAPI.CardsAPI.CreateCard("EXAMPLE_CARD_NAME", "ID_LIST", {
	["Description"] = "You're Fantastic Card Description", --> Type: String
	["idLabels"] = {'MyLabels1','MyLabel2'},  --> Type: Array (Table)
	["AttachmentLink"] = "https://roblox.com" --> Type: String
  })
```

{% hint style="info" %}
Note that you can remove one of that elements or just don't include the '**BoardOptionalData**' table.
{% endhint %}

### UpdateCard(CardId, BoardOptionalData)

Update an existing card, Return `true` if the function is successful `false` if the function fail.

```lua
TrelloAPI.CardsAPI.UpdateCard("ID_LIST", {
   ["Name"] = "My New Card Name", --> Type: String
   ["Description"] = "My fantastic Description", --> Type: String
   ["idLabels"] = {"ID1","ID2"}, --> Type: Array (Table)
   ["Closed"] = true || false --> Type: Boolean (Table),
   ['idList'] = "IDNewList"
})
```

{% hint style="info" %}
Note that you can remove one of that elements or just don't include the '**BoardOptionalData**' table.&#x20;
{% endhint %}

### DeleteCard(CardId)

Delete from list an existing card, Return `true` if the function is successful `false` if the function fail.

```lua
TrelloAPI.CardsAPI.DeleteCard("CARD_ID")
```

### CreateAttachmentOnCard(CardId,AttachmentUrl)

Create an CreateAttachment on a specific card, Only URL are supported,  Return `true` if the function is successful `false` if the function fail.

```lua
TrelloAPI.CardsAPI.CreateAttachmentOnCard("CARD_ID","https://www.example.com")
```

### DeleteAttachmentOnCard(CardId,Attachmentid)

Delete an Attachment from an existing card, Return `true` if the function is successful `false` if the function fail.

```lua
TrelloAPI.CardsAPI.DeleteAttachmentOnCard("CARD_ID", "ID_ATTACHMENT")
```

### GetCardOnList(BoardId,CardName)

Find  a specific card, if found return id of the card (String),  Return `false` if the function fail.

```lua
TrelloAPI.CardsAPI.GetCardOnList("BOARD_ID", "CARD_EXAMPLE_NAME")
```

### GetCardsOnList(ListId)

Return all the cards on the list,  Return `false` if the function fail.

```lua
TrelloAPI.CardsAPI.GetCardsOnList("LIST_ID")
```

### GetAttachmentsOnCard(CardId)

Return the Attachments Datas for the card, Return `false` if the function fail.

```lua
TrelloAPI.CardsAPI.GetAttachmentsOnCard("CARD_ID")
```
