php - Get all lead ads form facebook API
one text
Solution:
This is the correct GET request URL:
https://graph.facebook.com/v9.0/<PAGE_ID>/leadgen_forms?access_token=<page_access_token>
And example use of the FB PHP SDK:
try {
// Returns a `FacebookFacebookResponse` object
$response = $fb->get(
'/<PAGE_ID>/leadgen_forms',
'{access-token}'
);
} catch(FacebookExceptionsFacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
Source: Generated from the Graph API Explorer.
Screenshot of a working error-free response: 
Requirements:
- Use the page access token of the page
<PAGE_ID>(not your own user token or any other page). - Grant the
pages_show_list,pages_read_engagementandpages_manage_adspermissions to the FB app that you connect to (to get the page access token).
Source