curl --request POST \
--url https://api.wppfy.com/call/make \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"number": "5511999999999",
"call_duration": 15,
"fileUrl": "https://exemplo.com/audio.mp3"
}
'import requests
url = "https://api.wppfy.com/call/make"
payload = {
"number": "5511999999999",
"call_duration": 15,
"fileUrl": "https://exemplo.com/audio.mp3"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
number: '5511999999999',
call_duration: 15,
fileUrl: 'https://exemplo.com/audio.mp3'
})
};
fetch('https://api.wppfy.com/call/make', 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.wppfy.com/call/make",
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([
'number' => '5511999999999',
'call_duration' => 15,
'fileUrl' => 'https://exemplo.com/audio.mp3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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.wppfy.com/call/make"
payload := strings.NewReader("{\n \"number\": \"5511999999999\",\n \"call_duration\": 15,\n \"fileUrl\": \"https://exemplo.com/audio.mp3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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.wppfy.com/call/make")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"5511999999999\",\n \"call_duration\": 15,\n \"fileUrl\": \"https://exemplo.com/audio.mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/call/make")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"5511999999999\",\n \"call_duration\": 15,\n \"fileUrl\": \"https://exemplo.com/audio.mp3\"\n}"
response = http.request(request)
puts response.read_body{
"response": "Call request accepted locally, awaiting WhatsApp confirmation",
"confirmed": false,
"call": {
"id": "<string>",
"from": "<string>",
"callCreator": "<string>",
"callCreatorAlt": "<string>",
"groupJid": "<string>",
"fromMe": true,
"wasSentByAPI": true,
"source": "<string>",
"primaryJid": "<string>",
"alternateJid": "<string>",
"timestamp": 123,
"timestampISO": "2023-11-07T05:31:56Z",
"updatedAt": 123,
"updatedAtISO": "2023-11-07T05:31:56Z",
"participants": [
"<string>"
]
},
"audio": {
"requested": true,
"mode": "call",
"queued": true,
"fileUrl": "<string>",
"input": "<string>",
"source": "<string>",
"playback": "starts_when_call_is_ready"
}
}Iniciar chamada de voz
Inicia uma chamada de voz para um contato específico. Este endpoint permite:
- Iniciar chamadas de voz para contatos
- Funciona apenas com números válidos do WhatsApp
- O contato receberá uma chamada de voz
Sem fileUrl, o endpoint apenas faz o telefone do contato tocar e não
estabelece uma comunicação de voz bidirecional.
Com fileUrl, a API reproduz o arquivo quando a chamada é atendida e
encerra a ligação ao final do áudio. São aceitos MP3, WAV e OGG/Opus por
URL HTTP(S), data URI ou base64, com limite de 25 MB.
Opcional: Use call_duration para definir por quantos segundos a chamada deve tocar.
Após esse período a chamada é encerrada automaticamente, sem precisar chamar /call/reject.
Use 0 para não limitar a reprodução do áudio por tempo.
Exemplo de requisição:
{
"number": "5511999999999",
"call_duration": 0,
"fileUrl": "https://exemplo.com/audio.mp3"
}
Exemplo de resposta:
{
"response": "Call request accepted locally, awaiting WhatsApp confirmation",
"confirmed": false,
"audio": {
"requested": true,
"playback": "starts_when_call_is_ready"
}
}
Erros comuns:
- 401: Token inválido ou expirado
- 400: Número inválido ou ausente
- 500: Erro ao iniciar chamada
curl --request POST \
--url https://api.wppfy.com/call/make \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"number": "5511999999999",
"call_duration": 15,
"fileUrl": "https://exemplo.com/audio.mp3"
}
'import requests
url = "https://api.wppfy.com/call/make"
payload = {
"number": "5511999999999",
"call_duration": 15,
"fileUrl": "https://exemplo.com/audio.mp3"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
number: '5511999999999',
call_duration: 15,
fileUrl: 'https://exemplo.com/audio.mp3'
})
};
fetch('https://api.wppfy.com/call/make', 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.wppfy.com/call/make",
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([
'number' => '5511999999999',
'call_duration' => 15,
'fileUrl' => 'https://exemplo.com/audio.mp3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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.wppfy.com/call/make"
payload := strings.NewReader("{\n \"number\": \"5511999999999\",\n \"call_duration\": 15,\n \"fileUrl\": \"https://exemplo.com/audio.mp3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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.wppfy.com/call/make")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"5511999999999\",\n \"call_duration\": 15,\n \"fileUrl\": \"https://exemplo.com/audio.mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/call/make")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"5511999999999\",\n \"call_duration\": 15,\n \"fileUrl\": \"https://exemplo.com/audio.mp3\"\n}"
response = http.request(request)
puts response.read_body{
"response": "Call request accepted locally, awaiting WhatsApp confirmation",
"confirmed": false,
"call": {
"id": "<string>",
"from": "<string>",
"callCreator": "<string>",
"callCreatorAlt": "<string>",
"groupJid": "<string>",
"fromMe": true,
"wasSentByAPI": true,
"source": "<string>",
"primaryJid": "<string>",
"alternateJid": "<string>",
"timestamp": 123,
"timestampISO": "2023-11-07T05:31:56Z",
"updatedAt": 123,
"updatedAtISO": "2023-11-07T05:31:56Z",
"participants": [
"<string>"
]
},
"audio": {
"requested": true,
"mode": "call",
"queued": true,
"fileUrl": "<string>",
"input": "<string>",
"source": "<string>",
"playback": "starts_when_call_is_ready"
}
}Autorizações
Corpo
Número do contato no formato internacional (ex: 5511999999999)
"5511999999999"
Duração máxima da chamada em segundos. Use 0 ou omita para não limitar o áudio por tempo.
x >= 015
Áudio MP3, WAV ou OGG/Opus por URL HTTP(S), data URI ou base64, com até 25 MB. A reprodução começa quando a chamada é atendida.
"https://exemplo.com/audio.mp3"
Resposta
Chamada iniciada com sucesso
Mensagem de confirmação
"Call request accepted locally, awaiting WhatsApp confirmation"
Indica se a chamada já foi confirmada pelo WhatsApp na resposta inicial
false
Metadados da chamada criada
Show child attributes
Show child attributes
Presente quando fileUrl foi informado
Show child attributes
Show child attributes
