我正在创建一个应用程序,需要在与帐户关联的各个页面和帖子上显示Facebook营销数据,如见解,cpm等。到目前为止我还没弄清楚。我创建了一个应用程序,并尝试使用相应的访问令牌从沙箱帐户拨打电话。运行演示代码以阅读广告帐户的名称和年龄时,我收到以下错误。这真令人沮丧,我的雇主也生气了。任何帮助表示赞赏。
代码(node.js):
const adsSdk = require('facebook-nodejs-ads-sdk');
const accessToken = 'Sandbox acct token';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const AdAccount = adsSdk.AdAccount;
const account = new AdAccount(XX Sandbox ID XX);
console.log(account.id)
account
.read([AdAccount.Fields.name, AdAccount.Fields.age])
.then((account) => {
logPassedTest(test1 + ':Pass', account);
})
.catch((error) => {
console.log(error);
});
错误:
message: 'Unsupported get request. Object with ID \'XXX\' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api',
{ error:
{ message: 'Unsupported get request. Object with ID \'XXX\' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api',
type: 'GraphMethodException',
code: 100,
error_subcode: 33,
fbtrace_id: 'ACp+q8Bas3Z' } },
method: 'GET',
url: 'https://graph.facebook.com/v2.11/X?fields=name%2Cage&access_token=XX',
data: {} }
答案 0 :(得分:0)
AdAccount ID的前缀为act_
即。 act_<ACCOUNT_ID>
。
答案 1 :(得分:-1)
实际上没有办法调试这个。错误代码可能意味着您正在为正在进行的通话提供错误的对象。
转到:https://developers.facebook.com/tools/explorer/
插入您的访问令牌以及您正在进行的确切通话。如果呼叫失败,请删除它的部分直到成功。