When trying to create a card using the API through the developers website with an attachment (see below)
var request = require("request");
var options = {
method: 'POST',
url: 'https://api.trello.com/1/cards',
qs: {
name: 'New Card',
desc: 'this is the description',
idList: '{my idList here}',
fileSource: 'data:text/plain;name=ads.txt;base64,Z29vZ2xlLmNvbSwgcHViLTMyNDQzOTEzNDI4NDE4NjksIERJUkVDVCwgZjA4YzQ3ZmVjMDk0MmZhMA==',
keepFromSource: 'all',
key: '{my key here}',
token: '{my token here}'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
I get this as the response:
{"message":"Must provide either url or file""error":"VALIDATOR_INVALID_VALUE"}
But I am providing a "fileSource" so I'm not sure why it's telling me that I must provide either url or file when I am providing a file. I can't seem to get around this.
Any help would be appreciated.
Thanks,
Nir