Add contact to Campaign
http
POST https://services.leadconnectorhq.com/contacts/{contactId}/campaigns/{campaignId}Authorization
| 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. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
contactId | string | Yes | 3bZD1nQzbul0MCancbQD | Contact Id |
campaignId | string | Yes | Y2I9XM7aO1hncuSOlc9L | Campaigns Id |
Body
Responses
201 - Successful response
succeded(boolean): Example:True
json
{
"succeded": true
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/contacts/YOUR_contactId/campaigns/YOUR_campaignId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://services.leadconnectorhq.com/contacts/YOUR_contactId/campaigns/YOUR_campaignId', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/contacts/YOUR_contactId/campaigns/YOUR_campaignId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/contacts/YOUR_contactId/campaigns/YOUR_campaignId');
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(None),
]);
$data = json_decode(curl_exec($ch), true);