Start a placement test
curl --request POST \
--url https://cloudapi.mailercloud.com/v2/placement/tests \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"campaign_id": "Hws",
"provider_ids": [
"1",
"2"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v2/placement/tests"
payload = {
"campaign_id": "Hws",
"provider_ids": ["1", "2"]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({campaign_id: 'Hws', provider_ids: ['1', '2']})
};
fetch('https://cloudapi.mailercloud.com/v2/placement/tests', 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://cloudapi.mailercloud.com/v2/placement/tests",
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([
'campaign_id' => 'Hws',
'provider_ids' => [
'1',
'2'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: <content-type>"
],
]);
$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://cloudapi.mailercloud.com/v2/placement/tests"
payload := strings.NewReader("{\n \"campaign_id\": \"Hws\",\n \"provider_ids\": [\n \"1\",\n \"2\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"test_id": "<string>",
"status": "running",
"started_at": "2023-11-07T05:31:56Z",
"seeds_total": 123,
"tests_left": 123,
"eta_at": "2023-11-07T05:31:56Z",
"eta_seconds": 123
}
}{
"error": "<string>",
"code": "INVALID_INPUT"
}{
"error": "<string>",
"code": "ADDON_INACTIVE"
}{
"error": "<string>",
"code": "CAMPAIGN_NOT_FOUND"
}{
"error": "<string>",
"code": "CAMPAIGN_TYPE_UNSUPPORTED",
"resets_on": "<string>",
"test_id": "<string>"
}{
"error": "<string>",
"code": "PLACEMENT_UNAVAILABLE"
}Start a placement test
Sends a draft campaign to seed mailboxes at the chosen providers and reports where it lands (inbox, Gmail tabs, spam, missing). Each test uses one test from your Advanced Inbox Tracker allowance.
Only draft regular campaigns with a subject, sender and content can be tested. Only one test can run per campaign at a time. If the draft has not changed since its last test, set confirm_unchanged to true to spend another test.
Poll Get a placement test until status is no longer running; eta_at gives the expected finish time.
POST
/
v2
/
placement
/
tests
Start a placement test
curl --request POST \
--url https://cloudapi.mailercloud.com/v2/placement/tests \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"campaign_id": "Hws",
"provider_ids": [
"1",
"2"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v2/placement/tests"
payload = {
"campaign_id": "Hws",
"provider_ids": ["1", "2"]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({campaign_id: 'Hws', provider_ids: ['1', '2']})
};
fetch('https://cloudapi.mailercloud.com/v2/placement/tests', 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://cloudapi.mailercloud.com/v2/placement/tests",
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([
'campaign_id' => 'Hws',
'provider_ids' => [
'1',
'2'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: <content-type>"
],
]);
$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://cloudapi.mailercloud.com/v2/placement/tests"
payload := strings.NewReader("{\n \"campaign_id\": \"Hws\",\n \"provider_ids\": [\n \"1\",\n \"2\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"test_id": "<string>",
"status": "running",
"started_at": "2023-11-07T05:31:56Z",
"seeds_total": 123,
"tests_left": 123,
"eta_at": "2023-11-07T05:31:56Z",
"eta_seconds": 123
}
}{
"error": "<string>",
"code": "INVALID_INPUT"
}{
"error": "<string>",
"code": "ADDON_INACTIVE"
}{
"error": "<string>",
"code": "CAMPAIGN_NOT_FOUND"
}{
"error": "<string>",
"code": "CAMPAIGN_TYPE_UNSUPPORTED",
"resets_on": "<string>",
"test_id": "<string>"
}{
"error": "<string>",
"code": "PLACEMENT_UNAVAILABLE"
}Authorizations
Body
application/json