Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create cards with long description without exceeding URL length

Snir Israeli
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 26, 2019

Hey,

So I'm using the API to create a trello card and I want to set a quite large description.

The way the endpoint works is that, despite it being a POST request, all the fields for the card (including non-card related like key and token) are query parameters.

That leads to a very long URL which of course fails.

 

Any way we can send the description field in the post body to avoid this issue?

 

Thanks 

2 answers

1 accepted

1 vote
Answer accepted
ManuR
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 27, 2019

Hi again Snir,


I'm just posting my reply from our thread together here so others can see how to format their call.

 

curl --request POST \
--url 'https://api.trello.com/1/cards?idList=idList&keepFromSource=all&key=YOURAPIKEY&token=YOURTOKEN' \
--header 'Content-Type: application/json' \
--data '{
"name": "Card Name",
"pos": "top",
"idList": "idLIST",
"desc": "When copying an existing card into a new card with idCardSource checklist items are always unchecked and due dates are never marked as complete regardless of their corresponding values in the source card."
}'

0 votes
Jossef Harush
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 18, 2022

Move your description from the url params to the body. e.g.:

```python

def set_card_description(card_id, description):
      params = {
      'key': TRELLO_KEY,
      'token': TRELLO_TOKEN,
    }

    body = {
      'desc': description
    }

    r = requests.put(f'https://api.trello.com/1/cards/{card_id}', params=params, json=body)
    r.raise_for_status()
    return r.json()

```

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events