Capture leads in Facebook ads — lead ads provide people with a quick and privacy-safe way to sign up to receive information from your business.
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
facebook_lead_ads: {
type: "app",
app: "facebook_lead_ads",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://graph.facebook.com/v17.0/me/`,
headers: {
Authorization: `Bearer ${this.facebook_lead_ads.$auth.oauth_access_token}`,
},
})
},
})
Facebook Lead Ads uses OAuth authentication. When you connect your Facebook Lead Ads account, Pipedream will open a popup window where you can sign into Facebook Lead Ads and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Facebook Lead Ads API.
Pipedream requests the following authorization scopes when you connect your account:
email
public_profile
ads_management
leads_retrieval
pages_show_list
pages_read_engagement
pages_manage_ads
pages_manage_cta
GET
https://www.facebook.com/v17.0/dialog/oauth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://graph.facebook.com/v17.0/oauth/access_token
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
client_secret={{oauth.client_secret}}
&
code={{oauth.code}}
content-type: application/x-www-form-urlencoded
accept: application/json
POST
https://graph.facebook.com/v17.0/oauth/access_token
?
grant_type=fb_exchange_token
&
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
fb_exchange_token={{oauth.access_token}}
content-type: application/x-www-form-urlencoded
accept: application/json