Data JSON in response for DELETE /media_key


#1

Hello,

As part of the v4 Ads API, we’re updating the way we’re deleting videos to use DELETE /mediakey directly.
The documentation specifies the following format:

{
  "data": {
    "tweeted": true,
    "duration": 14330,
    "name": "mountains-on-ads.twitter.com",
    "file_name": "mountains.mp4",
    "description": "",
    "media_url": "https://video.twimg.com/ext_tw_video/860318603387600896/pu/vid/1280x720/xI3DbvWKxdvICsFW.mp4",
    "media_category": "TWEET_VIDEO",
    "poster_image_url": "https://pbs.twimg.com/media/C_B3bTRVYAAFBFt.jpg",
    "poster_image_media_key": "3_860318839740915712",
    "media_key": "7_860318603387600896",
    "created_at": "2017-05-05T02:21:53Z",
    "media_status": "TRANSCODE_COMPLETED",
    "media_id": 860318603387600896,
    "title": "uploaded on ads.twitter.com",
    "media_type": "VIDEO",
    "aspect_ratio": "16:9",
    "updated_at": "2017-05-05T02:26:58Z",
    "deleted": true
  }
}

However when we make the calls we receive a different format:

{
  "response_body": {
    "request": {
      "params": {
        "account_id": "18ce54gohlh",
        "media_key": "13_940870590159884289"
      }
    },
    "data": {
      "media_key": "13_940870590159884289",
      "media_id": null,
      "media_category": null,
      "media_type": null
    }
  }
}

Can you please confirm what format is correct?


#2

@MGruau

Please make sure your media_key is correct. I checked your account but it looks like 13_940870590159884289 isn’t in your media library and that’s why you get “null” in this case.

Best,
Shohei


#3

Hi @jrsyo, thanks for your answer.

Two things here:

twurl -X GET -H ads-api.twitter.com /4/accounts/18ce54gohlh/media_library/7_897833657821536259
{
   "request" : {
      "params" : {
         "media_key" : "7_897833657821536259",
         "account_id" : "18ce54gohlh"
      }
   },
   "data" : {
      "updated_at" : "2017-12-15T11:46:13Z",
      "media_category" : "TWEET_VIDEO",
      "poster_image_media_key" : "3_897833657821536259",
      "tweeted" : true,
      "media_id" : "897833657821536259",
      "duration" : 53435,
      "file_name" : "video twit https://t.co/NEsGuIYhbN",
      "deleted" : false,
      "description" : null,
      "media_type" : "VIDEO",
      "aspect_ratio" : "16:9",
      "poster_image_url" : "https://pbs.twimg.com/ext_tw_video_thumb/897833657821536259/pu/img/AJjkipNa9sxOJRI5.jpg",
      "media_key" : "7_897833657821536259",
      "media_status" : "TRANSCODE_COMPLETED",
      "title" : "Untitled #7_897833657821536259",
      "media_url" : "https://video.twimg.com/ext_tw_video/897833657821536259/pu/vid/1280x720/My6dJy9jDCB0Chol.mp4",
      "name" : null,
      "created_at" : "2017-08-16T14:53:19Z"
   }
}
twurl -X DELETE -H ads-api.twitter.com /4/accounts/18ce54gohlh/media_library/7_897833657821536259
{
   "request" : {
      "params" : {}
   },
   "errors" : [
      {
         "code" : "MEDIA_BAD_REQUEST_ERROR",
         "message" : "Invalid media: invalid account or media key"
      }
   ]
}

Please tell us if this is the wrong way.


#4

@jrsyo Can you please confirm ?


#5

Hi @MGruau ,

Sorry for not responding this earlier. We’re investigating this internally. So far, we noticed that there definitely some change we made that is causing this. We will get back to you once we got all the necessary information. Thank you for your patience.

Best,
Shohei