Schedule Campaign
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/campaign/schedule/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"scheduled_at": "2021-04-17 15:48:00"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/campaign/schedule/{id}"
payload = { "scheduled_at": "2021-04-17 15:48:00" }
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({scheduled_at: '2021-04-17 15:48:00'})
};
fetch('https://cloudapi.mailercloud.com/v1/campaign/schedule/{id}', 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/schedule/{id}",
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([
'scheduled_at' => '2021-04-17 15:48:00'
]),
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/schedule/{id}"
payload := strings.NewReader("{\n \"scheduled_at\": \"2021-04-17 15:48:00\"\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))
}{
"message": "Campaign has been scheduled"
}{
"errors": [
{
"field": "scheduled_at",
"message": "scheduled_at does not match the YYYY-MM-DD hh:mm:ss format"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Schedule Campaign
API for scheduling campaign. If the schedule_at is not given, the campaign will schedule for the current time.
POST
/
campaign
/
schedule
/
{id}
Schedule Campaign
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/campaign/schedule/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"scheduled_at": "2021-04-17 15:48:00"
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/campaign/schedule/{id}"
payload = { "scheduled_at": "2021-04-17 15:48:00" }
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({scheduled_at: '2021-04-17 15:48:00'})
};
fetch('https://cloudapi.mailercloud.com/v1/campaign/schedule/{id}', 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/schedule/{id}",
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([
'scheduled_at' => '2021-04-17 15:48:00'
]),
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/schedule/{id}"
payload := strings.NewReader("{\n \"scheduled_at\": \"2021-04-17 15:48:00\"\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))
}{
"message": "Campaign has been scheduled"
}{
"errors": [
{
"field": "scheduled_at",
"message": "scheduled_at does not match the YYYY-MM-DD hh:mm:ss format"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}{
"errors": [
{
"field": "id",
"message": "Record not found with the given Id"
}
]
}Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Headers
application/json
Path Parameters
Campaign Id
Body
application/json
Schedule time for your email campaign. Pass your timezone date-time format for accurate results.
Format: 2021-04-23 15:04:05
Minimum string length:
1Response
OK
Show child attributes
Show child attributes
⌘I