Create a new Facebook conversation lead form
http
POST https://services.leadconnectorhq.com/ad-publishing/facebook/conversation-formsAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | loc_abc123 | Account identifier |
name | string | Yes | Welcome Form | Conversation form name |
text | string | Yes | Hi! How can we help? | Welcome message text |
questions(object[], required): Quick-reply questions shown in the welcome message of the conversation formquestion(string, required): Question title text Example:How can we help?response(string): Auto-response message Example:Thanks for reaching out
Responses
201 - Response
400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/ad-publishing/facebook/conversation-forms' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "loc_abc123",
"name": "Welcome Form",
"text": "Hi! How can we help?",
"questions": [
{
"question": "How can we help?",
"response": "Thanks for reaching out! A team member will assist you shortly."
},
{
"question": "I want to learn more",
"response": "Great! Here is a link to our services."
}
]
}'const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/conversation-forms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "loc_abc123", "name": "Welcome Form", "text": "Hi! How can we help?", "questions": [{"question": "How can we help?", "response": "Thanks for reaching out! A team member will assist you shortly."}, {"question": "I want to learn more", "response": "Great! Here is a link to our services."}]}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/ad-publishing/facebook/conversation-forms',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "loc_abc123", "name": "Welcome Form", "text": "Hi! How can we help?", "questions": [{"question": "How can we help?", "response": "Thanks for reaching out! A team member will assist you shortly."}, {"question": "I want to learn more", "response": "Great! Here is a link to our services."}]},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/facebook/conversation-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({'locationId': 'loc_abc123', 'name': 'Welcome Form', 'text': 'Hi! How can we help?', 'questions': [{'question': 'How can we help?', 'response': 'Thanks for reaching out! A team member will assist you shortly.'}, {'question': 'I want to learn more', 'response': 'Great! Here is a link to our services.'}]}),
]);
$data = json_decode(curl_exec($ch), true);