Facebook营销api将视频上传到AdVideo

时间:2017-08-31 20:31:22

标签: php facebook-marketing-api

我是FB marketing API的新手。 我使用php创建了一个处理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();

我使用的视频不需要任何权限,可以直接下载。 当我运行该函数时,我收到以下错误消息: 键入:FacebookAds \ Exception \ Exception 代码:26 消息:无法打开文件" https://s3-us-west-2.amazonaws.com/unittest-tvpage-com/testsuite/videos/big_buck_bunny.mp4"

为什么文件无法打开的任何想法? 感谢

1 个答案:

答案 0 :(得分:0)

根据文档: https://developers.facebook.com/docs/marketing-api/reference/ad-account/advideos

要使用网址添加视频,请使用file_url而不是sourcesource参数用于上传文件。