Error POST accounts/:account_id/videos Ads API



i can not POST accounts/:account_id/videos although i have uploaded video successfully.
stdClass Object
[media_id] => 681329556741984256
[media_id_string] => 681329556741984256
[size] => 702858
[expires_after_secs] => 86400
[video] => stdClass Object
[video_type] => video/mp4


It return error : [code] => NOT_FOUND
[message] => Media not found
I don’t know why, anyone explain it for me, please


From your dump, I assume that you are using PHP to upload.
There are several potential problems that you could check:

  • The uploaded media expires 1 day after uploading (86400 seconds). Have you uploaded it within 24 hours before trying to POST to the Promoted Video method?
  • Are you using $upload_reply->media_id_string instead of $upload_reply->media_id? PHP may not handle 64-bit integers the way you’d expect it to.


Thank you very much !
I tried to upload media before it was expired 1 day :blush:


And what about the media_id_string property?


We also have useful code samples, but not currently in PHP: