Trello Rest API - card cover images not working

Hi,

I think a recent change with unsplash has perhaps made the image card cover no longer function when using the put to function.

When I use the image URL from unsplash, in this instance black sailing boat digital wallpaper photo – Free Boat Image on Unsplash

I get an error “400 url must be from an allowed image service”

If I add images before the domain, that is https://images.unsplash.com/photos/DKix6Un55mw

I instead get an error “400 Failed to get image from url”.

I assume based on these two errors that the api is looking for “images.unsplash” to validate that it is an allowed service. However it seems unsplash may not be using this address.

Keen for your insight!

Cheers
Shane

I don’t think that the ID in the URL of an image on Unsplash’s website is the same as the ID used in Trello’s API/picker.

Taking a look at the browser’s network tab when I attach an Unsplash image via the web client’s UI, I see a PUT to /1/cards/:idCard with the following payload:

{
  "cover": {
    "url": "https://images.unsplash.com/photo-1624160719218-33eb1081919c?ixid=Mnw3MDY2fDB8MXxjb2xsZWN0aW9ufDZ8MzE3MDk5fHx8fHwyfHwxNjI0MzA5MDQ0&ixlib=rb-1.2.1&w=2560&h=2048&q=90"
  }
}

If I copy the image location from the link you shared (Black sailing boat digital wallpaper photo – Free Night Image on Unsplash), I get a route that looks like the one I see the Trello client using:

https://images.unsplash.com/photo-1534447677768-be436bb09401?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2871&q=80

Can you try using that :point_up: and let me know what happens?