Comments (6)
You can use the FacebookAdsApiBatch
API (https://github.com/facebook/facebook-nodejs-ads-sdk/blob/master/src/api-batch.js#L17)
FB docs: https://developers.facebook.com/docs/marketing-api/asyncrequests/v2.11 (See Batch Requests
midway through)
You can probably do something like:
const batch = new FacebookAdsApiBatch(facebookApi);
batch.add(
'GET',
'path/to/request/campaign',
campaignSettings,
);
batch.add(
'GET',
'path/to/request/adset',
adsetSettings,
);
batch.add(
'GET',
'path/to/request/ad',
adSettings,
);
const response = await batch.execute();
from facebook-nodejs-business-sdk.
@josescasanova How does the adset/ad knows it belongs to the campaign added earlier to the batch request?
from facebook-nodejs-business-sdk.
@josescasanova How does the adset/ad knows it belongs to the campaign added earlier to the batch request?
https://developers.facebook.com/docs/graph-api/making-multiple-requests/#multiple_methods
Specifying dependencies between operations in the request:
{result=(parent operation name):(JSONPath expression)}
Example:
curl \
-F 'access_token=...' \
-F 'batch=[{ "method":"GET","name":"get-friends","relative_url":"me/friends?limit=5",},{"method":"GET","relative_url":"?ids={result=get-friends:$.data.*.id}"}]' \
https://graph.facebook.com/
from facebook-nodejs-business-sdk.
Wouldn't you just chain them up in a Promise chain?
from facebook-nodejs-business-sdk.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
from facebook-nodejs-business-sdk.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
from facebook-nodejs-business-sdk.
Related Issues (20)
- No permission to access this profile getGeneratePreview() error
- Issue importing 'FacebookRequestError' HOT 3
- Trying to run one of the basic SDK examples results in SDK crash HOT 1
- `AdVideo` fields are incorrect
- `getAds` never returns `video_id` field
- Is it possible to filter on Ad Creatives based on updated_at the way we do it in AdSets??
- How to have types / intellisense?
- Compile error because of partner_agent HOT 1
- App Events got ineligible for Meta AEM HOT 4
- How to filter leads by field_data or id?
- How to get the total spent amount for a campaign?
- Undefined headers in successful responses HOT 4
- Advertisers in Russia cannot create or run ads at this time. HOT 1
- Should AdCreativeLinkData.FormatOption include collection_video? HOT 1
- Can't set referrer url in ServerEvent HOT 1
- Is it possible to copy a leadgen form?
- Omitting 'fields' Query Parameter in FacebookAdsApiBatch via APIRequest with facebook-nodejs-business-sdk
- Getting a problematic warning when using the latest @types version
- Is there any changelog for changes from 19 to 20?
- Currency code capitalization? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-nodejs-business-sdk.