Testmail Group List
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/campaign/testmail-groups/list \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"search": "group_name/email"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/campaign/testmail-groups/list"
payload = { "search": "group_name/email" }
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({search: 'group_name/email'})
};
fetch('https://cloudapi.mailercloud.com/v1/campaign/testmail-groups/list', 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/v1/campaign/testmail-groups/list",
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([
'search' => 'group_name/email'
]),
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/v1/campaign/testmail-groups/list"
payload := strings.NewReader("{\n \"search\": \"group_name/email\"\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": [
{
"emails": [
"sender@yourdomain.com",
"jacobwilson@gmail.com",
"harrybrook@yahoo.com"
],
"group_name": "Demo Group",
"id": "SS"
},
{
"emails": [
"sender@yourdomain.com"
],
"group_name": "Demo",
"id": "SK"
}
]
}{
"error": {
"field": "-",
"message": "Invalid input"
}
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}Testmail Group List
Get the details of all the testmail groups you have created.
POST
/
campaign
/
testmail-groups
/
list
Testmail Group List
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/campaign/testmail-groups/list \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"search": "group_name/email"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/campaign/testmail-groups/list"
payload = { "search": "group_name/email" }
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({search: 'group_name/email'})
};
fetch('https://cloudapi.mailercloud.com/v1/campaign/testmail-groups/list', 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/v1/campaign/testmail-groups/list",
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([
'search' => 'group_name/email'
]),
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/v1/campaign/testmail-groups/list"
payload := strings.NewReader("{\n \"search\": \"group_name/email\"\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": [
{
"emails": [
"sender@yourdomain.com",
"jacobwilson@gmail.com",
"harrybrook@yahoo.com"
],
"group_name": "Demo Group",
"id": "SS"
},
{
"emails": [
"sender@yourdomain.com"
],
"group_name": "Demo",
"id": "SK"
}
]
}{
"error": {
"field": "-",
"message": "Invalid input"
}
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}⌘I