Create a new LinkedIn lead gen form for an ad account
http
POST https://services.leadconnectorhq.com/ad-publishing/linkedin/{accountId}/formAuthorization
| 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. |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | HChooFuiyPpVYzeJ4HMe | Account identifier |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
owner | object | Yes | Form owner | |
creationLocale | object | Yes | Creation locale | |
name | string | Yes | Contact Us | Form name |
state | string | Yes | PUBLISHED | Form state Possible values: 'PUBLISHED' |
content | object | Yes | Form content |
hiddenFields(object[]): Hidden fieldsname(string, required): Field name Example:utm_sourcevalue(string, required): Field value Example:linkedin
Responses
201 - Response
400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/ad-publishing/linkedin/YOUR_accountId/form' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"name": "Contact Us",
"state": "PUBLISHED",
"hiddenFields": [
{
"name": "utm_source",
"value": "linkedin"
}
]
}'const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/linkedin/YOUR_accountId/form', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name": "Contact Us", "state": "PUBLISHED", "hiddenFields": [{"name": "utm_source", "value": "linkedin"}]}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/ad-publishing/linkedin/YOUR_accountId/form',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"name": "Contact Us", "state": "PUBLISHED", "hiddenFields": [{"name": "utm_source", "value": "linkedin"}]},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/linkedin/YOUR_accountId/form');
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({'name': 'Contact Us', 'state': 'PUBLISHED', 'hiddenFields': [{'name': 'utm_source', 'value': 'linkedin'}]}),
]);
$data = json_decode(curl_exec($ch), true);