curl -X POST 'https://services.leadconnectorhq.com/ad-publishing/facebook/page/YOUR_pageId/forms' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"type": "MORE_VOLUME",
"name": "Contact Form",
"locationId": "loc_abc123",
"questions": [
{
"key": "full_name",
"type": "FULL_NAME",
"options": []
},
{
"key": "email_address",
"type": "EMAIL",
"options": []
},
{
"key": "are_you_interested",
"label": "Are you interested?",
"type": "CUSTOM",
"options": [
{
"value": "Yes"
},
{
"value": "No"
}
]
}
],
"questionPageHeadline": "Tell us about yourself",
"privacyPolicyLink": "https://example.com/privacy",
"privacyPolicyText": "We respect your privacy"
}'
const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/page/YOUR_pageId/forms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"type": "MORE_VOLUME", "name": "Contact Form", "locationId": "loc_abc123", "questions": [{"key": "full_name", "type": "FULL_NAME", "options": []}, {"key": "email_address", "type": "EMAIL", "options": []}, {"key": "are_you_interested", "label": "Are you interested?", "type": "CUSTOM", "options": [{"value": "Yes"}, {"value": "No"}]}], "questionPageHeadline": "Tell us about yourself", "privacyPolicyLink": "https://example.com/privacy", "privacyPolicyText": "We respect your privacy"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/ad-publishing/facebook/page/YOUR_pageId/forms',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"type": "MORE_VOLUME", "name": "Contact Form", "locationId": "loc_abc123", "questions": [{"key": "full_name", "type": "FULL_NAME", "options": []}, {"key": "email_address", "type": "EMAIL", "options": []}, {"key": "are_you_interested", "label": "Are you interested?", "type": "CUSTOM", "options": [{"value": "Yes"}, {"value": "No"}]}], "questionPageHeadline": "Tell us about yourself", "privacyPolicyLink": "https://example.com/privacy", "privacyPolicyText": "We respect your privacy"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/facebook/page/YOUR_pageId/forms');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'type': 'MORE_VOLUME', 'name': 'Contact Form', 'locationId': 'loc_abc123', 'questions': [{'key': 'full_name', 'type': 'FULL_NAME', 'options': []}, {'key': 'email_address', 'type': 'EMAIL', 'options': []}, {'key': 'are_you_interested', 'label': 'Are you interested?', 'type': 'CUSTOM', 'options': [{'value': 'Yes'}, {'value': 'No'}]}], 'questionPageHeadline': 'Tell us about yourself', 'privacyPolicyLink': 'https://example.com/privacy', 'privacyPolicyText': 'We respect your privacy'}),
]);
$data = json_decode(curl_exec($ch), true);