curl -X POST https://zapclass.com.br/api/messages/audio \
-H "Content-Type: application/json" \
-H "Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP" \
-d '{
"number": "5511999999999",
"file": "https://download.samplelib.com/mp3/sample-3s.mp3",
"message": "Segue o áudio solicitado",
"delay": 3000,
"forward": true,
"message_repy_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"message_source": "typebot",
"message_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"mentions": "5511999999999,5511888888888",
"read": true,
"read_messages": true
}'
const response = await fetch("https://zapclass.com.br/api/messages/audio", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP",
},
body: JSON.stringify({
number: "5511999999999",
file: "https://download.samplelib.com/mp3/sample-3s.mp3",
message: "Segue o áudio solicitado",
delay: 3000,
forward: true,
message_repy_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
message_source: "typebot",
message_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
mentions: "5511999999999,5511888888888",
read: true,
read_messages: true,
}),
});
<?php
$ch = curl_init('https://zapclass.com.br/api/messages/audio');
$payload = [
"number" => "5511999999999",
"file" => "https://download.samplelib.com/mp3/sample-3s.mp3",
"message" => "Segue o áudio solicitado",
"delay" => 3000,
"forward" => true,
"message_repy_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"message_source" => "typebot",
"message_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"mentions" => "5511999999999,5511888888888",
"read" => true,
"read_messages" => true
];
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
{
"success": true,
"id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"chat_id": "5511999999999@s.whatsapp.net"
}
{
"success": false,
"message": "Token de autenticação inválido"
}
Mensagens
Enviar Áudio
Enviar mensagem de áudio
POST
/
messages
/
audio
curl -X POST https://zapclass.com.br/api/messages/audio \
-H "Content-Type: application/json" \
-H "Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP" \
-d '{
"number": "5511999999999",
"file": "https://download.samplelib.com/mp3/sample-3s.mp3",
"message": "Segue o áudio solicitado",
"delay": 3000,
"forward": true,
"message_repy_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"message_source": "typebot",
"message_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"mentions": "5511999999999,5511888888888",
"read": true,
"read_messages": true
}'
const response = await fetch("https://zapclass.com.br/api/messages/audio", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP",
},
body: JSON.stringify({
number: "5511999999999",
file: "https://download.samplelib.com/mp3/sample-3s.mp3",
message: "Segue o áudio solicitado",
delay: 3000,
forward: true,
message_repy_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
message_source: "typebot",
message_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
mentions: "5511999999999,5511888888888",
read: true,
read_messages: true,
}),
});
<?php
$ch = curl_init('https://zapclass.com.br/api/messages/audio');
$payload = [
"number" => "5511999999999",
"file" => "https://download.samplelib.com/mp3/sample-3s.mp3",
"message" => "Segue o áudio solicitado",
"delay" => 3000,
"forward" => true,
"message_repy_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"message_source" => "typebot",
"message_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"mentions" => "5511999999999,5511888888888",
"read" => true,
"read_messages" => true
];
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
{
"success": true,
"id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"chat_id": "5511999999999@s.whatsapp.net"
}
{
"success": false,
"message": "Token de autenticação inválido"
}
Tipos de arquivos suportados
- AAC (.aac) - até 16 MB
- AMR (.amr) - até 16 MB
- MP3 (.mp3) - até 16 MB
- MP4 Audio (.m4a) - até 16 MB
- OGG (.ogg) - até 16 MB
Authorization
string
required
Chave de autenticação da sua conexão, utilizada no header Authorization como
Bearer Token.
Você encontra sua API Key no botão API da sua conexão no painel ZapClass.
A chave sempre começa com o prefixo
Exemplo:
Você encontra sua API Key no botão API da sua conexão no painel ZapClass.
A chave sempre começa com o prefixo
zc_. Exemplo:
zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aPBody Parameters
string
required
Número do destinatário no formato internacional.
Deve incluir código do país DDI + DDD + número.
Exemplo:
Deve incluir código do país DDI + DDD + número.
Exemplo:
5511999999999string
required
URL ou Base64da do arquivo enviado.
Exemplo:
Exemplo:
https://download.samplelib.com/mp3/sample-3s.mp3string
Conteúdo da mensagem de texto a ser enviada.
Suporta texto simples, emojis e caracteres especiais.
Exemplo:
Suporta texto simples, emojis e caracteres especiais.
Exemplo:
Olá! Bem-vindo à nossa plataforma ZapClassinteger
Atraso em milissegundos antes do envio (agendamento).
Útil para envios programados ou intervalos entre mensagens.
Aparecerá “Digitando…” antes do envio.
Exemplo:
Útil para envios programados ou intervalos entre mensagens.
Aparecerá “Digitando…” antes do envio.
Exemplo:
3000boolean
Marca a mensagem como encaminhada para o destinatário.
Exemplo:
Exemplo:
truestring
Identificador da mensagem para responder.
Exemplo:
Exemplo:
5511999999999:1AB2C3DEFG4H56I78JKL9Mstring
Origem do envio da mensagem.
Normalmente usado para rastreamento da mensagem.
Exemplo:
Normalmente usado para rastreamento da mensagem.
Exemplo:
typebotstring
Identificador do envio da mensagem.
Combinado com o
Exemplo:
Combinado com o
message_source pode ser usado para rastreamento. Exemplo:
5511999999999:1AB2C3DEFG4H56I78JKL9Mstring
Relação de números de telefone a serem mencionados na mensagem.
O números devem ser separads por vírgula.
Exemplo:
O números devem ser separads por vírgula.
Exemplo:
5511999999999,5511888888888boolean
Marca a conversa como lida após o envio.
Exemplo:
Exemplo:
trueboolean
Marca as últimas mensagens como lidas após o envio.
Exemplo:
Exemplo:
truecurl -X POST https://zapclass.com.br/api/messages/audio \
-H "Content-Type: application/json" \
-H "Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP" \
-d '{
"number": "5511999999999",
"file": "https://download.samplelib.com/mp3/sample-3s.mp3",
"message": "Segue o áudio solicitado",
"delay": 3000,
"forward": true,
"message_repy_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"message_source": "typebot",
"message_id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"mentions": "5511999999999,5511888888888",
"read": true,
"read_messages": true
}'
const response = await fetch("https://zapclass.com.br/api/messages/audio", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP",
},
body: JSON.stringify({
number: "5511999999999",
file: "https://download.samplelib.com/mp3/sample-3s.mp3",
message: "Segue o áudio solicitado",
delay: 3000,
forward: true,
message_repy_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
message_source: "typebot",
message_id: "5511999999999:1AB2C3DEFG4H56I78JKL9M",
mentions: "5511999999999,5511888888888",
read: true,
read_messages: true,
}),
});
<?php
$ch = curl_init('https://zapclass.com.br/api/messages/audio');
$payload = [
"number" => "5511999999999",
"file" => "https://download.samplelib.com/mp3/sample-3s.mp3",
"message" => "Segue o áudio solicitado",
"delay" => 3000,
"forward" => true,
"message_repy_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"message_source" => "typebot",
"message_id" => "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"mentions" => "5511999999999,5511888888888",
"read" => true,
"read_messages" => true
];
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer zc_6FrX2qjM4bHT9pR6cC0sD8wLkG3nE2tZfV5uN1aP'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
{
"success": true,
"id": "5511999999999:1AB2C3DEFG4H56I78JKL9M",
"chat_id": "5511999999999@s.whatsapp.net"
}
{
"success": false,
"message": "Token de autenticação inválido"
}
⌘I

