[英]Marketing API Facebook SDK
抱歉,但是我对Facebook SDK和API还是陌生的。 我尝试使用Facebook本身提供的营销API。
在快速入门中,我遵循了网站本身提供的所有步骤。
它将生成示例代码以用于我的简单应用程序。
我遇到了一个错误,必须更改一条线,如下所示,并认为它将来可能会帮助其他人。
如果遇到错误,告诉您以下不推荐使用的v2.11检查
由此
$fields = array(
);
$params = array(
'name' => 'Test Catalog',
);
$product_catalog = (new Business($business_id))->createProductCatalog(
$fields,
$params
);
对此
$fields = array(
);
$params = array(
'name' => 'Test Catalog',
);
$product_catalog = (new Business($business_id))->createOwnedProductCatalog(
$fields,
$params
);
现在,继续解决我的问题。
代码的第二部分如下所示
$fields = array(
);
$params = array(
'name' => 'Test Feed',
'schedule' => array('interval' => 'DAILY','url' => 'https://developers.facebook.com/resources/dpa_product_catalog_sample_feed.csv','hour' => '22'),
);
echo json_encode((new ProductCatalog($product_catalog_id))->createProductFeed(
$fields,
$params
)->getResponse()->getContent(), JSON_PRETTY_PRINT);
我这部分有问题
)->getResponse()->getContent(), JSON_PRETTY_PRINT);
我得到的错误是这个
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined method FacebookAds\Object\ProductFeed::getResponse()
任何帮助将不胜感激。
更改此:
echo json_encode((new ProductCatalog($product_catalog_id))->createProductFeed(
$fields,
$params
)->getResponse()->getContent(), JSON_PRETTY_PRINT);
为了这:
echo json_encode((new ProductCatalog($id))->createProductFeed(
$fields,
$params
)->exportAllData(), JSON_PRETTY_PRINT);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.