Use this API to create and delete test leads.
You can use this tool to create and delete test leads for your forms; however, you cannot use the tool in developer mode.
You can create one test lead per form. You'll need to delete an existing lead in order to create a new one.
Use this tool to test if your integration with Facebook's Webhooks is sucessful. Here are the steps to use this tool to debug your integration.
The leads created using this tool are organic leads that are not associated with any ad. Only one lead can be created per form. Therefore, to re-create a lead for the same form, click Delete Lead to first delete, then lead, and then re-create it.
You can test your leads via the Test button after you setup Webhooks for your app. The button is inside the Webhooks dashboard for the app.
You can create a test lead by making a POST
request to /{FORM_ID}/test_leads
.
For this request to succeed, the following requirements must be met:
Advertiser
or above on the page under which the form was created.curl \ -F "access_token=<ACCESS_TOKEN>" \ "https://graph.facebook.com/API_VERSION/FORM_ID/test_leads"
You can customize the test lead content by passing the following parameters:
field_data
: A vector parameter with name
and values
pairs.custom_disclaimer_responses
: A vector parameter with checkbox_key
and is_checked
pairs.curl \ -F "field_data=[{'name': 'favorite_color?', 'values': ['yellow']}, {'name': 'email', 'values': ['test@test.com']}]" \ -F "custom_disclaimer_responses=[{'checkbox_key': 'my_checkbox', 'is_checked': true}]" \ -F "access_token=<ACCESS_TOKEN>" \ "https://graph.facebook.com/API_VERSION/FORM_ID/test_leads"
The leads created from the above calls are fake leads and are therefore not associated with any ads.
You can read the test leads associated with a Lead Ads form by making a GET
call to the {FORM_ID}/test_leads
endpoint.
curl \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.facebook.com/API_VERSION/FORM_ID/test_leads"
If you are testing your integration, to delete a lead so that you can resubmit, make the following API call:
curl -X DELETE \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.facebook.com/<API_VERSION>/<LEAD_ID>"
Only the owner of the lead can delete the lead.