{{-- ── API Integration Panel ──────────────────────────────────── --}}
Landing Page API Integration
Click to expand —
give
this to your marketing site developer
{{-- Endpoint --}}
POST — accepts JSON body ·
rate
limited to 5 req/min per IP
X-Landing-Key — only enforced if LANDING_API_KEY is set in your .env. If unset, the endpoint accepts requests
without a
key.
{{-- Fields table --}}
Field
Type
Required
Description
@foreach([
['company_name', 'string', '✅ Yes', 'Name of the developer / company
enquiring'],
['contact_name', 'string', '✅ Yes', 'Person submitting the enquiry'],
['email', 'string', '✅ Yes', 'Contact email address'],
['phone', 'string', 'No', 'Phone number (without country code)'],
['country_code', 'string', 'No', 'Default +91. e.g. +971, +44'],
['city', 'string', 'No', 'City'],
['country', 'string', 'No', 'Country'],
['num_projects', 'number', 'No', 'Approx. number of projects they manage'],
['website', 'string', 'No', 'Company website URL'],
['message', 'string', 'No', 'Free-text message from the lead'],
['utm_source', 'string', 'No', 'e.g. google, linkedin, referral'],
['utm_medium', 'string', 'No', 'e.g. cpc, email, organic'],
['utm_campaign', 'string', 'No', 'Campaign name'],
['landing_page', 'string', 'No', 'Identifier for the page (e.g.
pricing-page)'],
] as [$f,$t,$r,$d])
{{ $f }}
{{ $t }}
{{ $r }}
{{ $d }}
@endforeach
{{-- Response format --}}
{
"success": true,
"message": "Thank you! Our team will reach out to you shortly."
}
Returns 200 (same body) instead of 201 if a lead with the same email was already
submitted in the last 24h — treated as a duplicate, not an error.
// 401 — bad/missing X-Landing-Key (only if LANDING_API_KEY is set)
{ "error": "Unauthorized." }
// 422 — validation failed
{ "message": "The company name field is required.", "errors": {...} }
// 429 — rate limited
{ "error": "Too many submissions. Try again in 45 seconds." }
{{-- Code tabs --}}
async function submitPlatformLead(data) {
const res = await fetch('{{ url('/api/platform-leads') }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Landing-Key': 'YOUR_API_KEY_HERE', // omit if LANDING_API_KEY is unset
},
body: JSON.stringify({
company_name: data.company_name, // required
contact_name: data.contact_name, // required
email: data.email, // required
phone: data.phone,
country_code: '+91',
city: data.city,
country: data.country,
num_projects: data.num_projects,
website: data.website,
message: data.message,
utm_source: new URLSearchParams(location.search).get('utm_source'),
utm_medium: new URLSearchParams(location.search).get('utm_medium'),
utm_campaign: new URLSearchParams(location.search).get('utm_campaign'),
landing_page: 'your-page-name-here',
}),
});
const json = await res.json();
if (res.ok) alert(json.message);
}