The image & video returned from cards API returns HTTP 404 error for few cards.
Following is the request:

Get: /11/accounts/:account_id/cards

Response:
{
  "name": "Name",
  "components": [
    {
      "media_key": "123",
      "media_metadata": {
        "123": {
          "type": "IMAGE",
          "url": "https://pbs.twimg.com/media/FGvR18oVcAQvvzk.jpg",
          "width": 1200,
          "height": 1200
        }
      },
      "type": "MEDIA"
    },
    {
      "title": "Panda",
      "destination": {
        "url": "url",
        "type": "WEBSITE"
      },
      "type": "DETAILS"
    }
  ],
  "id": "12345678",
  "created_at": "2021-12-16T15:22:14Z",
  "card_uri": "card://12345",
  "updated_at": "2021-12-26T15:22:14Z",
  "deleted": false,
  "card_type": "IMAGE_WEBSITE"
}

Get: /11/accounts/:account_id/cards/poll
{
  "video_poster_height": "9",
  "name": "Poll",
  "start_time": "2021-08-10T05:07:06Z",
  "first_choice": "Choice",
  "third_choice": "Choice",
  "video_height": "9",
  "content_duration_seconds": "62",
  "media_url": "https://video.twimg.com/amplify_video/vmap/1425683394910851072.vmap",
  "fourth_choice": "Choice",
  "second_choice": "Choice",
  "end_time": "2021-08-1T05:07:06Z",
  "id": "1234",
  "video_width": "16",
  "created_at": "2021-08-10T05:07:06Z",
  "duration_in_minutes": "8640",
  "poster_media_url": "https://pbs.twimg.com/amplify_video_thumb/1425683394910851072/img/CnMUhTg6yU4OrFiY.jpg",
  "card_uri": "card://1234567",
  "updated_at": "2021-08-12T05:07:06Z",
  "video_poster_width": "16",
  "deleted": false,
  "card_type": "VIDEO_POLLS"
}

Following are few url’s returned from API with status 404
https://pbs.twimg.com/media/FGvR18oVcAQvvzk.jpg,
https://pbs.twimg.com/media/FGvR2f_VIAkGo_v.png,

Could you please help us with why these links have stopped working?

Hi @preeti_dantkale,

Could you provide the ad account id, and the card id of both the cards?

Account Id: “18ce557v11g”
Card Id: “1471500925982298117”, “dgk9k”

I’ve shared 2 card Id’s, we have multiple such cards where media url returns 404 code.

Thanks. For the card 1471500925982298117, the media_key is 3_1471500428005175300 and when querying for this media using media_library endpoint, a different media url is returned:

"media_url": "https://pbs.twimg.com/media/FGvR18oVcAQ0BfU.jpg"

And this url works. The url returned in the card endpoint https://pbs.twimg.com/media/FGvR18oVcAQvvzk.jpg is perhaps deleted at some point. I’ll dig further and update again.

We managed to find out that at the time the card was created with the media, the owner of the media was a public status account, and hence the media URL in the card is a public URL. The owner subsequently changed privacy status, so the public URLs now no longer work.

The URL returned from the media_library endpoint is the protected media URL, thus it works. So the main reason those media URLs do not work is because they were generated as public URLs based on the owner account’s status at that time, but it has been changed to protected account and hence the
public URLs no longer work.