Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trello api add PDF attachment will always return unsuccessful response

Hi guys,

When I upload a pdf to a Trello card. the response will always include this:

bytes: null,

isUpload: false,

as if the upload failed. But the upload actually succeeded....
This only happens when I upload a pdf

I tried to play with the mime type I used: application/pdf, x-pdf, image/png

Does anyone know how to get the API to return a successful response?

Thanks in advance!

3 answers

I figured it out. The file needs to be in a form using I'm on PowerShell 7 and I believe you might have to get into some .NET to make it work on PS5.1.

$FORM = @{
    idList     = "xxxxxx"
    pos        = "top"
    name       = "TestTest"
    fileSource = []"C:\Path\Path\File.pdf"

Invoke-RestMethod -Method Post -Uri "$APIKEY" -Form $FORM


I'm having the same issue using Invoke-RestMethod in PowerShell in creating a new card with a PDF attachment. If the attachment is a simple .txt it works fine. I'm guessing it has something to do with encoding. Does anyone have a code example in PowerShell with attaching anything other than a .txt to a new card?

Iain Dooley Community Leader Sep 29, 2020

Thanks for the tip, I posted over there and will relay the answer here if I get one

0 votes
Iain Dooley Community Leader May 26, 2020

@Jamahl M-D I've never been able to make file uploading work in the Trello API, I just attach links -- internally they're represented as links anyway. You might like to review the discussion here:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

3,635 views 25 63
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you