简体   繁体   中英

Facebook marketing api upload video to AdVideo

I'm new to FB marketing API. I'm using php to create a function which handles the creation of the adVideo:

 public function getUploadVideo() {
    Api::init($this->appId, $this->appSecret,$this->token);
    $video = new Advideo(null, 'act_' . $this->adAccountId);
    $video->{AdVideoFields::SOURCE} = 'https://s3-us-west 2 .amazonaws.com /unittest-tvpage-com/testsuite/videos/big_buck_bunny.mp4';
    $video->{AdVideoFields::NAME} = 'test_video';
    $x = $video->create();

The video I'm using does not need any permissions and it can be directly downloaded. When I run the function I get the following error message: Type: FacebookAds\\Exception\\Exception Code: 26 Message: couldn't open file " https://s3-us-west-2.amazonaws.com/unittest-tvpage-com/testsuite/videos/big_buck_bunny.mp4 "

Any ideas why the file could not be opened? Thanks

As per documentation: https://developers.facebook.com/docs/marketing-api/reference/ad-account/advideos

To add the video using the url is file_url not source . The source parameter is used for uploading a file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM