Add leads to a campaign
curl --request POST \
--url https://api.botdog.co/v1/leads/add_to_campaign \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"campaignId": "123e4567-e89b-12d3-a456-426614174000",
"leads": [
{
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"name": "John Doe",
"title": "Software Engineer",
"company": "Acme Inc.",
"location": "San Francisco, CA",
"customAttributes": {
"customKey1": "customValue1",
"customKey2": "customValue2"
}
}
]
}
'import requests
url = "https://api.botdog.co/v1/leads/add_to_campaign"
payload = {
"campaignId": "123e4567-e89b-12d3-a456-426614174000",
"leads": [
{
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"name": "John Doe",
"title": "Software Engineer",
"company": "Acme Inc.",
"location": "San Francisco, CA",
"customAttributes": {
"customKey1": "customValue1",
"customKey2": "customValue2"
}
}
]
}
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({
campaignId: '123e4567-e89b-12d3-a456-426614174000',
leads: [
{
linkedinUrl: 'https://www.linkedin.com/in/johndoe',
name: 'John Doe',
title: 'Software Engineer',
company: 'Acme Inc.',
location: 'San Francisco, CA',
customAttributes: {customKey1: 'customValue1', customKey2: 'customValue2'}
}
]
})
};
fetch('https://api.botdog.co/v1/leads/add_to_campaign', 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://api.botdog.co/v1/leads/add_to_campaign",
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([
'campaignId' => '123e4567-e89b-12d3-a456-426614174000',
'leads' => [
[
'linkedinUrl' => 'https://www.linkedin.com/in/johndoe',
'name' => 'John Doe',
'title' => 'Software Engineer',
'company' => 'Acme Inc.',
'location' => 'San Francisco, CA',
'customAttributes' => [
'customKey1' => 'customValue1',
'customKey2' => 'customValue2'
]
]
]
]),
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://api.botdog.co/v1/leads/add_to_campaign"
payload := strings.NewReader("{\n \"campaignId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"leads\": [\n {\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"name\": \"John Doe\",\n \"title\": \"Software Engineer\",\n \"company\": \"Acme Inc.\",\n \"location\": \"San Francisco, CA\",\n \"customAttributes\": {\n \"customKey1\": \"customValue1\",\n \"customKey2\": \"customValue2\"\n }\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://api.botdog.co/v1/leads/add_to_campaign")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"leads\": [\n {\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"name\": \"John Doe\",\n \"title\": \"Software Engineer\",\n \"company\": \"Acme Inc.\",\n \"location\": \"San Francisco, CA\",\n \"customAttributes\": {\n \"customKey1\": \"customValue1\",\n \"customKey2\": \"customValue2\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botdog.co/v1/leads/add_to_campaign")
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 \"campaignId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"leads\": [\n {\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"name\": \"John Doe\",\n \"title\": \"Software Engineer\",\n \"company\": \"Acme Inc.\",\n \"location\": \"San Francisco, CA\",\n \"customAttributes\": {\n \"customKey1\": \"customValue1\",\n \"customKey2\": \"customValue2\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 50,
"campaignId": "123e4567-e89b-12d3-a456-426614174000"
}leads
Add leads to a campaign
Add leads to an existing campaign. Batch operation — up to 100 leads at a time.
POST
/
v1
/
leads
/
add_to_campaign
Add leads to a campaign
curl --request POST \
--url https://api.botdog.co/v1/leads/add_to_campaign \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"campaignId": "123e4567-e89b-12d3-a456-426614174000",
"leads": [
{
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"name": "John Doe",
"title": "Software Engineer",
"company": "Acme Inc.",
"location": "San Francisco, CA",
"customAttributes": {
"customKey1": "customValue1",
"customKey2": "customValue2"
}
}
]
}
'import requests
url = "https://api.botdog.co/v1/leads/add_to_campaign"
payload = {
"campaignId": "123e4567-e89b-12d3-a456-426614174000",
"leads": [
{
"linkedinUrl": "https://www.linkedin.com/in/johndoe",
"name": "John Doe",
"title": "Software Engineer",
"company": "Acme Inc.",
"location": "San Francisco, CA",
"customAttributes": {
"customKey1": "customValue1",
"customKey2": "customValue2"
}
}
]
}
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({
campaignId: '123e4567-e89b-12d3-a456-426614174000',
leads: [
{
linkedinUrl: 'https://www.linkedin.com/in/johndoe',
name: 'John Doe',
title: 'Software Engineer',
company: 'Acme Inc.',
location: 'San Francisco, CA',
customAttributes: {customKey1: 'customValue1', customKey2: 'customValue2'}
}
]
})
};
fetch('https://api.botdog.co/v1/leads/add_to_campaign', 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://api.botdog.co/v1/leads/add_to_campaign",
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([
'campaignId' => '123e4567-e89b-12d3-a456-426614174000',
'leads' => [
[
'linkedinUrl' => 'https://www.linkedin.com/in/johndoe',
'name' => 'John Doe',
'title' => 'Software Engineer',
'company' => 'Acme Inc.',
'location' => 'San Francisco, CA',
'customAttributes' => [
'customKey1' => 'customValue1',
'customKey2' => 'customValue2'
]
]
]
]),
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://api.botdog.co/v1/leads/add_to_campaign"
payload := strings.NewReader("{\n \"campaignId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"leads\": [\n {\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"name\": \"John Doe\",\n \"title\": \"Software Engineer\",\n \"company\": \"Acme Inc.\",\n \"location\": \"San Francisco, CA\",\n \"customAttributes\": {\n \"customKey1\": \"customValue1\",\n \"customKey2\": \"customValue2\"\n }\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://api.botdog.co/v1/leads/add_to_campaign")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"leads\": [\n {\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"name\": \"John Doe\",\n \"title\": \"Software Engineer\",\n \"company\": \"Acme Inc.\",\n \"location\": \"San Francisco, CA\",\n \"customAttributes\": {\n \"customKey1\": \"customValue1\",\n \"customKey2\": \"customValue2\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botdog.co/v1/leads/add_to_campaign")
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 \"campaignId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"leads\": [\n {\n \"linkedinUrl\": \"https://www.linkedin.com/in/johndoe\",\n \"name\": \"John Doe\",\n \"title\": \"Software Engineer\",\n \"company\": \"Acme Inc.\",\n \"location\": \"San Francisco, CA\",\n \"customAttributes\": {\n \"customKey1\": \"customValue1\",\n \"customKey2\": \"customValue2\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 50,
"campaignId": "123e4567-e89b-12d3-a456-426614174000"
}Authorizations
Body
application/json
Was this page helpful?
⌘I