what should i put here? I have never used graph API.
I have a client who has 4 differents ads, i need to access via php to the leads retrieve function for the 4 ads.
https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving/
I made a facebook app with his facebook account,and added my account as a Developer Role.
I’m trying trought the Graph API Explorer to understand how can i access to his business ads, so that i can test the leads retrieval.
Can someone help me?
Thanks.
2
Answers
To read all lead data and ad level data, you will need:
A Page or User access token requested by a person who can advertise on the ad account and on the Page
The ads_management permission
The leads_retrieval permission
The pages_show_list permission
The pages_read_engagement permission
The pages_manage_ads permission
In Your picture, you have not granted the lead retrieval information to the graph api. You can add manually or can grant permission from your developer account.
For getting lead, you can follow the process as follows, first from page_id, get the forms that are posted on leads.
/${ pageId }/leadgen_forms?access_token=${page_token }
Then you can get the lead form as well by using the leadID came from webhook.
/${ pageId }?access_token=${page_token }
To get the fields of the form that are uploaded. You can use this.
${ formId }?access_token=${ page_token }&fields=id,name,questions
I have worked on it and briefed it with step by step process here Click To Read, with the current latest version of Facebook Graph API with 17.0 version.
It will be helpful who want to capture leads from Facebook, and Instagram Ads campaigns via webhook to the CRM system.