curl --request POST \
--url https://api.l2msg.com/whatsapp/schedule \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"phone": "+5561999999999",
"text": "CRON REP TEST",
"sendAt": 1744228685,
"channel": "Channel",
"cronExpr": "*/3 * * * *",
"repeats": 2
}
'import requests
url = "https://api.l2msg.com/whatsapp/schedule"
payload = {
"phone": "+5561999999999",
"text": "CRON REP TEST",
"sendAt": 1744228685,
"channel": "Channel",
"cronExpr": "*/3 * * * *",
"repeats": 2
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone: '+5561999999999',
text: 'CRON REP TEST',
sendAt: 1744228685,
channel: 'Channel',
cronExpr: '*/3 * * * *',
repeats: 2
})
};
fetch('https://api.l2msg.com/whatsapp/schedule', 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.l2msg.com/whatsapp/schedule",
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([
'phone' => '+5561999999999',
'text' => 'CRON REP TEST',
'sendAt' => 1744228685,
'channel' => 'Channel',
'cronExpr' => '*/3 * * * *',
'repeats' => 2
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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.l2msg.com/whatsapp/schedule"
payload := strings.NewReader("{\n \"phone\": \"+5561999999999\",\n \"text\": \"CRON REP TEST\",\n \"sendAt\": 1744228685,\n \"channel\": \"Channel\",\n \"cronExpr\": \"*/3 * * * *\",\n \"repeats\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<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.l2msg.com/whatsapp/schedule")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"+5561999999999\",\n \"text\": \"CRON REP TEST\",\n \"sendAt\": 1744228685,\n \"channel\": \"Channel\",\n \"cronExpr\": \"*/3 * * * *\",\n \"repeats\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.l2msg.com/whatsapp/schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"+5561999999999\",\n \"text\": \"CRON REP TEST\",\n \"sendAt\": 1744228685,\n \"channel\": \"Channel\",\n \"cronExpr\": \"*/3 * * * *\",\n \"repeats\": 2\n}"
response = http.request(request)
puts response.read_body{
"id": "780bd49b-f451-46f8-b60d-1526bdda9a27",
"phone": "+5561999999999",
"text": "CRON REP TEST",
"sendAt": 1744228685,
"channel": "Channel",
"cronExpr": "*/3 * * * *",
"repeats": 2
}Create Schedule
Create Schedule
curl --request POST \
--url https://api.l2msg.com/whatsapp/schedule \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"phone": "+5561999999999",
"text": "CRON REP TEST",
"sendAt": 1744228685,
"channel": "Channel",
"cronExpr": "*/3 * * * *",
"repeats": 2
}
'import requests
url = "https://api.l2msg.com/whatsapp/schedule"
payload = {
"phone": "+5561999999999",
"text": "CRON REP TEST",
"sendAt": 1744228685,
"channel": "Channel",
"cronExpr": "*/3 * * * *",
"repeats": 2
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone: '+5561999999999',
text: 'CRON REP TEST',
sendAt: 1744228685,
channel: 'Channel',
cronExpr: '*/3 * * * *',
repeats: 2
})
};
fetch('https://api.l2msg.com/whatsapp/schedule', 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.l2msg.com/whatsapp/schedule",
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([
'phone' => '+5561999999999',
'text' => 'CRON REP TEST',
'sendAt' => 1744228685,
'channel' => 'Channel',
'cronExpr' => '*/3 * * * *',
'repeats' => 2
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <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.l2msg.com/whatsapp/schedule"
payload := strings.NewReader("{\n \"phone\": \"+5561999999999\",\n \"text\": \"CRON REP TEST\",\n \"sendAt\": 1744228685,\n \"channel\": \"Channel\",\n \"cronExpr\": \"*/3 * * * *\",\n \"repeats\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<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.l2msg.com/whatsapp/schedule")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"+5561999999999\",\n \"text\": \"CRON REP TEST\",\n \"sendAt\": 1744228685,\n \"channel\": \"Channel\",\n \"cronExpr\": \"*/3 * * * *\",\n \"repeats\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.l2msg.com/whatsapp/schedule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"+5561999999999\",\n \"text\": \"CRON REP TEST\",\n \"sendAt\": 1744228685,\n \"channel\": \"Channel\",\n \"cronExpr\": \"*/3 * * * *\",\n \"repeats\": 2\n}"
response = http.request(request)
puts response.read_body{
"id": "780bd49b-f451-46f8-b60d-1526bdda9a27",
"phone": "+5561999999999",
"text": "CRON REP TEST",
"sendAt": 1744228685,
"channel": "Channel",
"cronExpr": "*/3 * * * *",
"repeats": 2
}Authorizations
Your authorization key header
Body
O número de telefone de destino com código do país.
O texto da mensagem a ser enviada.
O timestamp Unix de quando a mensagem deve ser enviada.
O canal de envio da mensagem.
A expressão cron para agendamentos recorrentes (opcional).
O número de repetições para o agendamento recorrente (opcional, só pode ser usado com cronExpr e sem until).
Timestamp Unix até quando a mensagem deve ser repetida (opcional, só pode ser usado com cronExpr e sem repeats).
Response
Ok
O identificador único do agendamento.
O número de telefone de destino com código do país.
O texto da mensagem a ser enviada.
O timestamp Unix de quando a mensagem deve ser enviada.
O canal de envio da mensagem.
A expressão cron para agendamentos recorrentes.
O número de repetições para o agendamento recorrente.