私は、アカウントに関連付けられたさまざまなページや投稿に、インサイト、cpmなどのFacebookマーケティングデータを表示する必要があるアプリを作成しています。私はこれまでこれを理解することができませんでした。アプリを作成し、適切なアクセストークンでサンドボックスアカウントからの呼び出しを試みました。デモコードを実行して広告アカウントの名前と年齢を読み取ると、次のエラーが表示されます。これは本当にイライラしており、私の雇用主は怒っています。どんな助けもありがとうございます。マーケティングAPIを使用してFacebookアナリティクスデータにアクセスするにはどうすればよいですか?
コード(の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: {} }
'act_'プレフィックスを使用しても、私はまだ同じエラーコード/結果を取得しています –