The file parameter documentation for the POST /1/cards/[card id or shortlink]/attachments API call does not specify how the file should be encoded. For "Valid Values" it simply says "A file". If we are using html forms, then we can attach file using below code.
<form action="https://api.trello.com/1/cards/REPLACE_WITH_CARD_ID/attachments"
method="POST" enctype="multipart/form-data">
<input type="hidden" name="key" value="REPLACE_WITH_YOUR_KEY" />
<input type="hidden" name="token" value="REPLACE_WITH_YOUR_WRITE_TOKEN" />
<input type="file" name="file">
<input type="submit" value="Upload">
</form>But I am not using html forms. I need to call Trello card attachment API from server side of Node JS. I was wondering if anyone has a working example of how to get files into Trello cards using the API.