使用 FB 创建 Facebook 广告时未找到给定广告组的创意规范 api

No creative spec found for given adgroup while creating Facebook ads using FB api

我有一个 Facebook 活动、广告集和一个使用 Facebook API 创建的广告。但是,当我尝试使用这三个端点创建广告时(:I think they are called endpoints) 出现错误No creative spec found for given adgroup. 这是我使用之前创建的图像、广告集和广告系列创建广告的代码:

FB.api('act_xxxxxxxx/adcreatives', 'POST', {
name: 'My Testworthy Ad Creative',
title: 'Facebook Marketing Partners',
body: 'Get exactly the things you need from your marketing.',
image_url: 'img url',
object_url: 'https://www.facebookmarketingpartners.com',
access_token:'app access token for selected permissions'

        },function(adcreativeresponse){
          console.log(adcreativeresponse.id);
          FB.api('/act_xxxxxxxx/ads','POST',  {
          creative:["{\"creative_id\" : \"adcreativeresponse.id /*or a static creative_id*/\"}"],
          name:"tryncatch",
          adset_id:"adsetId",
          status:"PAUSED",
          access_token:"app access token with the required permissions selected"},
          function(response) {
                                console.log("response for ad");
                                                 console.log(response);// 
                                                 Insert your code here
                             }
                                            );

                                        } );

如代码所示,我创建了一个 adcreative,其中 returns 创建了 adcreative 的节点 ID,我在 response 函数中使用它来创建一个 ad 和之前收集的所有参数,但它给我一个错误,如记录 "response for ad" 后提供的图像所示。

有没有我遗漏的东西。

参数对象中的键 creative 的值应该是:

"creative": {"creative_id":<CREATIVE_ID>} // without the array

如 Facebook 官方文档中所述 creating ads:

creative (AdCreative):

This field is required for create. The ID of the ad creative to be used by this ad. You can read more about creatives here. You should supply the ID within an object as follows:

{"creative_id": <CREATIVE_ID>}