Skip to main content
Create a new lead gen form on a Facebook page
POST https://services.leadconnectorhq.com/ad-publishing/facebook/page/{pageId}/forms

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

pageId
string
default:"103456789012345"
required
Facebook page identifier

Body

type
string
default:"MORE_VOLUME"
required
Lead form type Posibles valores: ‘MORE_VOLUME’, ‘HIGHER_INTENT’
name
string
default:"Contact Form"
required
Lead form name
locationId
string
default:"loc_abc123"
required
Account identifier
greetingCard
object
Greeting card config
questions
object[]
required
List of questions displayed on the lead form
questionPageHeadline
string
default:"Tell us about yourself"
Question page headline
Privacy policy URL
privacyPolicyText
string
default:"We respect your privacy"
Privacy policy text
customDisclaimer
object
Custom disclaimer config
thankYouPage
object
required
Thank you page config

Respuestas

{}
{}
{}

Ejemplo

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);