douduan5753 2017-06-21 10:41
浏览 30

在Facebook上批量上传大型目录

Using Facebook Marketing API, I need to Create and Update large quantity of products in the Catalog. So I am using "Batch Upload for Large Catalogs" for creating products in my catalog.

Reference Link: https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/product-catalog#catalog-update-options

I have installed the latest "Facebook-php-ads-sdk" and created a test catalog from my Facebook account.

use FacebookAds\Api;
use FacebookAds\Http\RequestInterface;

$catalogID = <<My Catalog ID>>; // Ex: 437777777777777 - Product Catalog ID 
of My Estore
$requests =  array(
    array(
        'method' => 'CREATE',
        'retailer_id' => 'retailer-product-id-123',
        'data' => array(
        'availability' => 'in stock',
        'brand' => 'Niky',
        'category' => 't-shirts',
        'currency' => 'USD',
        'description' => 'This is the product description.',
        'image_url' => 'http://www.images.example.com/t-shirts/1.png',
        'name' => 'My product name',
        'price' => '100',
        'url' => 'http://www.example.com/t-shirts/1.html',
        ),
    ),
);

$data = Api::instance()->call(
  '/'.$catalogID.'/batch',
  RequestInterface::METHOD_POST,
  array('requests' => $requests))->getContent();

When I integrated the Catalog ID with the above code, I am receiving the error and the products are not added to my catalog.

Error Occurred:

Fatal error: Uncaught exception 'FacebookAds\Http\Exception\AuthorizationException' with message 'Unsupported post request. Object with ID '437777777777777' does not exist, cannot be loaded due to missing permissions, or does not support this operation.
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 Revit2020下载问题
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch