Error POST accounts/:account_id/videos Ads API

api

#1

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


#2

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.

#3

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


#4

And what about the media_id_string property?


#5

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