gpt4 book ai didi

javascript - Facebook 营销 API - 无法创建广告集

转载 作者:行者123 更新时间:2023-11-28 04:49:41 31 4
gpt4 key购买 nike

我是 Facebook 营销 API 的新手。我能够创建一个广告系列。

但我似乎无法创建 Adset。

我尝试使用 Javascript 发布到广告集: https://graph.facebook.com/v2.8/act_156221465583672/adsets

使用此有效负载:

    var targeting = {
"age_max": 43,
"age_min": 18,
"geo_locations": { "countries": ["US"] }
};

var campaignId = "520337003094784508";

var promotedObject = {
'application_id': 2242592062246511
};

和帖子正文:

    {
"access_token": accessToken,
"name": "testNirAd",
"lifetime_budget": "8000",
"autobid": "true",
"start_time": new Date("October 13, 2017 00:00:00"),
"end_time": new Date("November 13, 2017 00:00:00"),
"optimization_goal": "POST_ENGAGEMENT",
"billing_event": "IMPRESSIONS",
"daily_budget": "2000",
"campaign_id": campaignId,
"targeting": JSON.stringify(targeting),
"status": "PAUSED"
}

但我收到此错误:

     {
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_data": {
"blame_field_specs": [
[
"name"
]
]
},
"error_subcode": 2061015,
"is_transient": false,
"error_user_title": "Required Field Is Missing",
"error_user_msg": "The name field is required. Please complete the
field to continue.",
"fbtrace_id": "HFg4HmwbQhG"
}

}

这很奇怪,因为我有一个名称字段。

然后我尝试使用 Javascript SDK 进行相同的操作 https://github.com/lucascosta/facebook-js-ads-sdk ,具有相同的有效负载数据,这次我得到: { 代码:1 fbtrace_id:“DcXmP0Wr82Q” 消息:“发生未知错误。” 类型:“OAuthException” }

请问有人可以帮忙吗?

最佳答案

还尝试使用不同的、较少的参数,使用 Curl,并得到相同的结果:

curl /
-F 'name=MyFirstTest' /
-F 'billing_event=IMPRESSIONS' /
-F 'bid_amount=2' /
-F 'daily_budget=1000' /
-F 'campaign_id=120330000094784508' /
-F 'targeting={"geo_locations":{"countries":["US"]}}' /
-F 'start_time=2017-10-14T16:06:09+0000' /
-F 'end_time=2017-11-21T16:06:09+0000' /
-F 'status=PAUSED' /
-F 'access_token= EAAf0hSLb7osBAEgUpUtkGydJ9mmfZCzYumfNVxDFUjBFtx7C8aos3x
LbzjwkZBEbgXkWAT75OvIy6HXNTFBEqN1ca1aVvWT3RQAAKAAi6jYyncTG3m9ae0MkZAM9gZDZD'
/https://graph.facebook.com/v2.8/act_116221225224746/adsets

得到:

{"error":{"message":"Invalid     
parameter","type":"OAuthException","code":100,"error_data":
{"blame_field_specs":[["name"]]},"error_subcode":2061015,"is_transient":
false,"error_user_title":"Required Field Is Missing","error_user_msg":"The
name field is required. Please complete the field to
continue.","fbtrace_id":"AeI4nngXTmj"}}

fbtrace_id:AeI4nngXTmj

顺便说一下,我使用的是沙盒帐户。

谢谢!

关于javascript - Facebook 营销 API - 无法创建广告集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43035583/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com