Facebook Ads API错误-未启用使用

Facebook Ads API错误-未启用使用,facebook,facebook-ads-api,Facebook,Facebook Ads Api,因此,我一直在尝试创建一个应用程序,使用Facebook广告API获取广告成本和统计数据。我已经创建了一个应用程序,并将我的广告帐户ID添加到应用程序设置中,但仍然出现错误: "error":{"message":"(#274) The ad account is not enabled for usage in Ads API. Please add it in developer.facebook.com -> application -> settings -> adva

因此,我一直在尝试创建一个应用程序,使用Facebook广告API获取广告成本和统计数据。我已经创建了一个应用程序,并将我的广告帐户ID添加到应用程序设置中,但仍然出现错误:

"error":{"message":"(#274) The ad account is not enabled for usage in Ads API. Please add it in developer.facebook.com -> application -> settings -> advanced -> advertising accounts -> Ads API. Account XXXXXXXXXXXXX not enabled for application XXXXXXXXXXXXX.","type":"OAuthException","code":274}}

你知道为什么它仍然会给我这个错误吗?或者如何完成此步骤。

在开发模式下使用Ads API时,需要指定要在开发人员控制台中使用的AdAccounts

有关详细信息,请参阅以下指南:

让我给你一些对我有帮助的解决方法。您必须转到应用程序,然后在左侧面板的“添加的产品”选项卡中,单击
营销API
,单击工具,在右侧选择所需的权限并获取令牌。现在使用此令牌,并将其与FB.api('POST'.调用以及其他参数一起传递。您将不会再收到错误,如果您检查您的广告,您将有一个新的活动或Adset,无论您尝试创建哪个。

我收到此#274错误,它在添加测试沙盒广告帐户的ID()在添加测试沙盒广告帐户的ID之前,我只添加了我的生产广告帐户的ID,由于某种原因,该ID不起作用

另外,当我使用Graph API Explorer进行测试Graph API调用时,右上角有一个应用程序选择框。出于某种原因,它默认为“Graph API Explorer”而不是我的应用程序的名称。每当我选择我的应用程序的名称并生成新的用户访问令牌时,我都能够发出类似于以下内容的请求:

//Get the Ad name associated with an AD_ID
https://graph.facebook.com/<API_VERSION>/<AD_ID>?fields=adset_id,campaign_id,name,account_id

//Get the Adset name associated with an ADSET_ID
https://graph.facebook.com/<API_VERSION>/<ADSET_ID>?fields=account_id,name

//Get the Campaign name associated with a CAMPAIGN_ID
https://graph.facebook.com/<API_VERSION>/<CAMPAIGN_ID>?fields=account_id,name
//获取与广告ID关联的广告名称
https://graph.facebook.com//?fields=adset_id,活动id,名称,帐户id
//获取与Adset\u ID关联的Adset名称
https://graph.facebook.com//?fields=account_id名称
//获取与活动ID关联的活动名称
https://graph.facebook.com//?fields=account_id名称