Create A/B split campaign
curl --request POST \
--url https://api.linkedcamp.com/v2/campaign_create_ab_variant \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"campaignId": "<string>"
}
'import requests
url = "https://api.linkedcamp.com/v2/campaign_create_ab_variant"
payload = { "campaignId": "<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({campaignId: '<string>'})
};
fetch('https://api.linkedcamp.com/v2/campaign_create_ab_variant', 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.linkedcamp.com/v2/campaign_create_ab_variant",
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' => '<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://api.linkedcamp.com/v2/campaign_create_ab_variant"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\"\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.linkedcamp.com/v2/campaign_create_ab_variant")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkedcamp.com/v2/campaign_create_ab_variant")
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\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api.linkedcamp.com/v2/campaign_create_ab_variant");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Api-Key", "<api-key>");
request.AddJsonBody("{\n \"campaignId\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}Campaigns
Create A/B split campaign
**Write.** It changes data in your account.
Split a campaign into an A/B pair so two versions of the sequence run against comparable halves of the audience. Compare them later with `analytics_campaign`. This SPLITS, it does not copy: the backend moves half of the not-yet-contacted leads out of the original into a new DRAFTED campaign, copies the flow, and renames the original to "<title> [A]". The original therefore ends up with half the audience it had. It needs more than 10 leads still waiting to be contacted and refuses otherwise with "Not enough leads to do AB testing, Duplicate campaign instead!" — in which case `campaign_duplicate` is the backend's own suggestion. Use `campaign_duplicate` when the audience should be left alone, and this when the point is to compare two versions on one audience.
POST
/
campaign_create_ab_variant
Create A/B split campaign
curl --request POST \
--url https://api.linkedcamp.com/v2/campaign_create_ab_variant \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"campaignId": "<string>"
}
'import requests
url = "https://api.linkedcamp.com/v2/campaign_create_ab_variant"
payload = { "campaignId": "<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({campaignId: '<string>'})
};
fetch('https://api.linkedcamp.com/v2/campaign_create_ab_variant', 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.linkedcamp.com/v2/campaign_create_ab_variant",
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' => '<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://api.linkedcamp.com/v2/campaign_create_ab_variant"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\"\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.linkedcamp.com/v2/campaign_create_ab_variant")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkedcamp.com/v2/campaign_create_ab_variant")
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\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api.linkedcamp.com/v2/campaign_create_ab_variant");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Api-Key", "<api-key>");
request.AddJsonBody("{\n \"campaignId\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "<string>",
"hint": "<string>"
}
}