Create Leadform
curl --request POST \
--url https://public.plai.io/meta/create_leadform \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"userId": "<string>",
"leadFormQuestions": [
{
"type": "<string>",
"label": "<string>",
"options": [
{
"value": "<string>",
"key": "<string>"
}
]
}
],
"privacyPolicyUrl": "<string>",
"privacyPolicyName": "<string>",
"questionPageCustomHeadline": "<string>",
"leadsFormName": "<string>",
"thankYouPage": {
"title": "<string>",
"body": "<string>",
"button_text": "<string>",
"button_type": "<string>",
"website_url": "<string>",
"country_code": "<string>",
"business_phone_number": "<string>"
},
"language": "<string>",
"form_type": "<string>",
"intro": {
"title": "<string>",
"style": "<string>",
"content": [
"<string>"
]
}
}
'import requests
url = "https://public.plai.io/meta/create_leadform"
payload = {
"userId": "<string>",
"leadFormQuestions": [
{
"type": "<string>",
"label": "<string>",
"options": [
{
"value": "<string>",
"key": "<string>"
}
]
}
],
"privacyPolicyUrl": "<string>",
"privacyPolicyName": "<string>",
"questionPageCustomHeadline": "<string>",
"leadsFormName": "<string>",
"thankYouPage": {
"title": "<string>",
"body": "<string>",
"button_text": "<string>",
"button_type": "<string>",
"website_url": "<string>",
"country_code": "<string>",
"business_phone_number": "<string>"
},
"language": "<string>",
"form_type": "<string>",
"intro": {
"title": "<string>",
"style": "<string>",
"content": ["<string>"]
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '<string>',
leadFormQuestions: [
{
type: '<string>',
label: '<string>',
options: [{value: '<string>', key: '<string>'}]
}
],
privacyPolicyUrl: '<string>',
privacyPolicyName: '<string>',
questionPageCustomHeadline: '<string>',
leadsFormName: '<string>',
thankYouPage: {
title: '<string>',
body: JSON.stringify('<string>'),
button_text: '<string>',
button_type: '<string>',
website_url: '<string>',
country_code: '<string>',
business_phone_number: '<string>'
},
language: '<string>',
form_type: '<string>',
intro: {title: '<string>', style: '<string>', content: ['<string>']}
})
};
fetch('https://public.plai.io/meta/create_leadform', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public.plai.io/meta/create_leadform",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>',
'leadFormQuestions' => [
[
'type' => '<string>',
'label' => '<string>',
'options' => [
[
'value' => '<string>',
'key' => '<string>'
]
]
]
],
'privacyPolicyUrl' => '<string>',
'privacyPolicyName' => '<string>',
'questionPageCustomHeadline' => '<string>',
'leadsFormName' => '<string>',
'thankYouPage' => [
'title' => '<string>',
'body' => '<string>',
'button_text' => '<string>',
'button_type' => '<string>',
'website_url' => '<string>',
'country_code' => '<string>',
'business_phone_number' => '<string>'
],
'language' => '<string>',
'form_type' => '<string>',
'intro' => [
'title' => '<string>',
'style' => '<string>',
'content' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public.plai.io/meta/create_leadform"
payload := strings.NewReader("{\n \"userId\": \"<string>\",\n \"leadFormQuestions\": [\n {\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n }\n ],\n \"privacyPolicyUrl\": \"<string>\",\n \"privacyPolicyName\": \"<string>\",\n \"questionPageCustomHeadline\": \"<string>\",\n \"leadsFormName\": \"<string>\",\n \"thankYouPage\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"button_text\": \"<string>\",\n \"button_type\": \"<string>\",\n \"website_url\": \"<string>\",\n \"country_code\": \"<string>\",\n \"business_phone_number\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"form_type\": \"<string>\",\n \"intro\": {\n \"title\": \"<string>\",\n \"style\": \"<string>\",\n \"content\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public.plai.io/meta/create_leadform")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\",\n \"leadFormQuestions\": [\n {\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n }\n ],\n \"privacyPolicyUrl\": \"<string>\",\n \"privacyPolicyName\": \"<string>\",\n \"questionPageCustomHeadline\": \"<string>\",\n \"leadsFormName\": \"<string>\",\n \"thankYouPage\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"button_text\": \"<string>\",\n \"button_type\": \"<string>\",\n \"website_url\": \"<string>\",\n \"country_code\": \"<string>\",\n \"business_phone_number\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"form_type\": \"<string>\",\n \"intro\": {\n \"title\": \"<string>\",\n \"style\": \"<string>\",\n \"content\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.plai.io/meta/create_leadform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\",\n \"leadFormQuestions\": [\n {\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n }\n ],\n \"privacyPolicyUrl\": \"<string>\",\n \"privacyPolicyName\": \"<string>\",\n \"questionPageCustomHeadline\": \"<string>\",\n \"leadsFormName\": \"<string>\",\n \"thankYouPage\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"button_text\": \"<string>\",\n \"button_type\": \"<string>\",\n \"website_url\": \"<string>\",\n \"country_code\": \"<string>\",\n \"business_phone_number\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"form_type\": \"<string>\",\n \"intro\": {\n \"title\": \"<string>\",\n \"style\": \"<string>\",\n \"content\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"results": {
"success": true,
"leadFormId": "<string>",
"error": "<string>"
}
}Lead Form
Create Leadform
This endpoint is used to create a leadform.
POST
/
meta
/
create_leadform
Create Leadform
curl --request POST \
--url https://public.plai.io/meta/create_leadform \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"userId": "<string>",
"leadFormQuestions": [
{
"type": "<string>",
"label": "<string>",
"options": [
{
"value": "<string>",
"key": "<string>"
}
]
}
],
"privacyPolicyUrl": "<string>",
"privacyPolicyName": "<string>",
"questionPageCustomHeadline": "<string>",
"leadsFormName": "<string>",
"thankYouPage": {
"title": "<string>",
"body": "<string>",
"button_text": "<string>",
"button_type": "<string>",
"website_url": "<string>",
"country_code": "<string>",
"business_phone_number": "<string>"
},
"language": "<string>",
"form_type": "<string>",
"intro": {
"title": "<string>",
"style": "<string>",
"content": [
"<string>"
]
}
}
'import requests
url = "https://public.plai.io/meta/create_leadform"
payload = {
"userId": "<string>",
"leadFormQuestions": [
{
"type": "<string>",
"label": "<string>",
"options": [
{
"value": "<string>",
"key": "<string>"
}
]
}
],
"privacyPolicyUrl": "<string>",
"privacyPolicyName": "<string>",
"questionPageCustomHeadline": "<string>",
"leadsFormName": "<string>",
"thankYouPage": {
"title": "<string>",
"body": "<string>",
"button_text": "<string>",
"button_type": "<string>",
"website_url": "<string>",
"country_code": "<string>",
"business_phone_number": "<string>"
},
"language": "<string>",
"form_type": "<string>",
"intro": {
"title": "<string>",
"style": "<string>",
"content": ["<string>"]
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: '<string>',
leadFormQuestions: [
{
type: '<string>',
label: '<string>',
options: [{value: '<string>', key: '<string>'}]
}
],
privacyPolicyUrl: '<string>',
privacyPolicyName: '<string>',
questionPageCustomHeadline: '<string>',
leadsFormName: '<string>',
thankYouPage: {
title: '<string>',
body: JSON.stringify('<string>'),
button_text: '<string>',
button_type: '<string>',
website_url: '<string>',
country_code: '<string>',
business_phone_number: '<string>'
},
language: '<string>',
form_type: '<string>',
intro: {title: '<string>', style: '<string>', content: ['<string>']}
})
};
fetch('https://public.plai.io/meta/create_leadform', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://public.plai.io/meta/create_leadform",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>',
'leadFormQuestions' => [
[
'type' => '<string>',
'label' => '<string>',
'options' => [
[
'value' => '<string>',
'key' => '<string>'
]
]
]
],
'privacyPolicyUrl' => '<string>',
'privacyPolicyName' => '<string>',
'questionPageCustomHeadline' => '<string>',
'leadsFormName' => '<string>',
'thankYouPage' => [
'title' => '<string>',
'body' => '<string>',
'button_text' => '<string>',
'button_type' => '<string>',
'website_url' => '<string>',
'country_code' => '<string>',
'business_phone_number' => '<string>'
],
'language' => '<string>',
'form_type' => '<string>',
'intro' => [
'title' => '<string>',
'style' => '<string>',
'content' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public.plai.io/meta/create_leadform"
payload := strings.NewReader("{\n \"userId\": \"<string>\",\n \"leadFormQuestions\": [\n {\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n }\n ],\n \"privacyPolicyUrl\": \"<string>\",\n \"privacyPolicyName\": \"<string>\",\n \"questionPageCustomHeadline\": \"<string>\",\n \"leadsFormName\": \"<string>\",\n \"thankYouPage\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"button_text\": \"<string>\",\n \"button_type\": \"<string>\",\n \"website_url\": \"<string>\",\n \"country_code\": \"<string>\",\n \"business_phone_number\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"form_type\": \"<string>\",\n \"intro\": {\n \"title\": \"<string>\",\n \"style\": \"<string>\",\n \"content\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://public.plai.io/meta/create_leadform")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\",\n \"leadFormQuestions\": [\n {\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n }\n ],\n \"privacyPolicyUrl\": \"<string>\",\n \"privacyPolicyName\": \"<string>\",\n \"questionPageCustomHeadline\": \"<string>\",\n \"leadsFormName\": \"<string>\",\n \"thankYouPage\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"button_text\": \"<string>\",\n \"button_type\": \"<string>\",\n \"website_url\": \"<string>\",\n \"country_code\": \"<string>\",\n \"business_phone_number\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"form_type\": \"<string>\",\n \"intro\": {\n \"title\": \"<string>\",\n \"style\": \"<string>\",\n \"content\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.plai.io/meta/create_leadform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\",\n \"leadFormQuestions\": [\n {\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"key\": \"<string>\"\n }\n ]\n }\n ],\n \"privacyPolicyUrl\": \"<string>\",\n \"privacyPolicyName\": \"<string>\",\n \"questionPageCustomHeadline\": \"<string>\",\n \"leadsFormName\": \"<string>\",\n \"thankYouPage\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"button_text\": \"<string>\",\n \"button_type\": \"<string>\",\n \"website_url\": \"<string>\",\n \"country_code\": \"<string>\",\n \"business_phone_number\": \"<string>\"\n },\n \"language\": \"<string>\",\n \"form_type\": \"<string>\",\n \"intro\": {\n \"title\": \"<string>\",\n \"style\": \"<string>\",\n \"content\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"results": {
"success": true,
"leadFormId": "<string>",
"error": "<string>"
}
}Request Body
string
required
User ID, If not already created, make a user on create user
page first. If already created,
retrieve the user ID from get profile
page.
object[]
required
Show Lead Form Questions Array
Show Lead Form Questions Array
string
required
Type of question
CUSTOM, CITY, COMPANY_NAME, COUNTRY, DOB, EMAIL, GENDER, FIRST_NAME, FULL_NAME, JOB_TITLE, LAST_NAME, MARITIAL_STATUS, WHATSAPP_NUMBER, EDUCATION_LEVEL, WEBSITE, PHONE, PHONE_OTP, POST_CODE, PROVINCE, RELATIONSHIP_STATUS, STATE, STREET_ADDRESS, ZIP, WORK_EMAIL, MILITARY_STATUS, WORK_PHONE_NUMBER, SLIDER, STORE_LOOKUP, STORE_LOOKUP_WITH_TYPEAHEAD, DATE_TIME, ID_CPF, ID_AR_DNI, ID_CL_RUT, ID_CO_CC, ID_EC_CI, ID_PE_DNI, ID_MX_RFC, JOIN_CODE, USER_PROVIDED_PHONE_NUMBER, FACEBOOK_LEAD_ID, EMAIL_ALIAS, MESSENGER, VIN, LICENSE_PLATEstring
Custom label for CUSTOM type questions
string
required
URL for the privacy policy
string
required
Display name for the privacy policy link
string
Custom headline text for the question page
string
required
Name for the leads form
object
required
Show Thank You Page Object
Show Thank You Page Object
string
required
Title displayed on thank you page
string
required
Body text displayed on thank you page
string
required
Text for the action button
string
required
Type of button:
VIEW_WEBSITE, CALL_BUSINESSstring
URL for the website button
This field must be required when
button_type is set to VISIT_WEBSITE.string
ISO 3166-1 alpha-2 country codes e.g:
US,UKThis field must be required when
button_type is set to CALL_BUSINESS.string
Business phone number to display
This field must be required when
button_type is set to CALL_BUSINESS.string
required
Language code for the form:
AR_AR, CS_CZ, DA_DK, DE_DE, EL_GR,
EN_GB, EN_US, ES_ES, ES_LA, FI_FI, FR_FR, HE_IL, HI_IN,
HU_HU, ID_ID, IT_IT, JA_JP, KO_KR, NB_NO, NL_NL, PL_PL,
PT_BR, PT_PT, RO_RO, RU_RU, SV_SE, TH_TH, TR_TR, VI_VN,
ZH_CN, ZH_HK, ZH_TWstring
required
Type of form:
MORE_VOLUME or HIGHER_INTENTobject
Response
boolean
Indicates that the HTTP response was successful (status code 200 OK).