Once your users have connected their Facebook Ads account, you can use the Paragon SDK to access Facebook Ads on behalf of connected users.See the Facebook Ads REST API documentation for their full API reference.Any Facebook Ads API endpoints can be accessed with the Paragon SDK as shown in this example.
JavaScript
Copy
Ask AI
// You can find your project ID in the Overview tab of any Integration.// Authenticate the userparagon.authenticate(<ProjectID>, <Paragon User Token>);// Get Campaignsawait paragon.request(‘facebookAds’, 'act_<AD_ACCOUNT_ID>/campaigns', { method: 'GET'})// Create a Campaignawait paragon.request('facebookAds', 'act_<AD_ACCOUNT_ID>/campaigns' , { method: 'POST', body: { name: "My First Campaign", objective: "POST_ENGAGEMENT", status: "PAUSED", special_ad_categories: [] }})
Once your Facebook Ads account is connected, you can add steps to perform the following actions:
Create Campaign
Update Campaign
Get Campaigns
Get Campaign by ID
Create Ad Set
Update Ad Set
Get Ad Sets
Get Ad Set by ID
Create Ad
Update Ad
Get Ad by ID
Build Ad Creative Object
Create Ad Creative
Create Lead Gen Form
Send Purchase Event
Send Lead Event
Send Funnel Event
You can also use the Facebook Ads Request step to access any of Facebook Ads’s API endpoints without the authentication piece.When using Facebook Ads, you can reference data from previous steps by typing {{ to invoke the variable menu.