简体   繁体   English

Facebook营销api上传视频到AdVideo

[英]Facebook marketing api upload video to AdVideo

I'm new to FB marketing API.我是 FB 营销 API 的新手。 I'm using php to create a function which handles the creation of the adVideo:我正在使用 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();

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 "当我运行该函数时,我收到以下错误消息:类型:FacebookAds\\Exception\\Exception 代码:26 消息:无法打开文件“ 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根据文档: https : //developers.facebook.com/docs/marketing-api/reference/ad-account/advideos

To add the video using the url is file_url not source .使用 url 添加视频是file_url而不是source The source parameter is used for uploading a file. source参数用于上传文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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