Closed shryder closed 5 years ago
How can I set a card's image? I checked https://developers.trello.com/reference#cards-2 to see how the api does it and tried this but doesn't work. Says that the fileSource is invalid.
How raw request should look like: curl --request POST \ --url 'https://api.trello.com/1/cards?idList=idList&fileSource=data%3Aimage%2Fpng%3Bname%3Dcoolscreenhot.png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAANUAAAAsCAMAAA&keepFromSource=all'
curl --request POST \ --url 'https://api.trello.com/1/cards?idList=idList&fileSource=data%3Aimage%2Fpng%3Bname%3Dcoolscreenhot.png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAANUAAAAsCAMAAA&keepFromSource=all'
How I tried doing it:
$this->client()->cards()->create([ 'idList' => 'listhere', 'name' => 'name here', 'desc' => 'cool description', 'fileSource' => 'data:image/png;name=test.png;base64,' . base64_encode(Storage::disk('local')->get('image.png')), ]);
Nevermind, I'm supposed to create a new attachement inside that card.
How can I set a card's image? I checked https://developers.trello.com/reference#cards-2 to see how the api does it and tried this but doesn't work. Says that the fileSource is invalid.
How raw request should look like:
curl --request POST \ --url 'https://api.trello.com/1/cards?idList=idList&fileSource=data%3Aimage%2Fpng%3Bname%3Dcoolscreenhot.png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAANUAAAAsCAMAAA&keepFromSource=all'
How I tried doing it: