facebook / facebook-nodejs-business-sdk

Node.js SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
499 stars 227 forks source link

How to build such a request via sdk? #218

Closed wenson closed 2 years ago

wenson commented 2 years ago

Which SDK version are you using?

"facebook-nodejs-business-sdk": "^12.0.0"

What's the issue?

How to build such a request via sdk?

act_22222222222/adsets?fields=ads {id,name,status}

Steps/Sample code to reproduce the issue

let fields = _.omit(bizSdk.AdSet.Fields, ['full_funnel_exploration_mode', 'existing_customer_budgetpercentage']); let adSets = await new bizSdk.AdAccount(fbAdAccount.actId, {}, null, api).getAdSets(.keys(fields), []);

Observed Results:

Expected Results:

wenson commented 2 years ago

found a way.

let fields = .omit(bizSdk.AdSet.Fields, ['full_funnel_exploration_mode', 'existing_customer_budgetpercentage']); fields = .merge(fields, { "ads{id,name,status}": "ads{id,name,status}"}) let adSets = await new bizSdk.AdAccount(fbAdAccount.actId, {}, null, api).getAdSets(.keys(fields), []);

it's worked .