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": "Solicitud de llamada aceptada localmente, esperando confirmación de WhatsApp",
"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 llamada de voz
Inicia una llamada de voz a un contacto específico. Este endpoint permite:
- Iniciar llamadas de voz a contactos
- Funciona solo con números válidos de WhatsApp
- El contacto recibirá una llamada de voz
Sin fileUrl, el endpoint solo hace sonar el teléfono del contacto y no
establece una comunicación de voz bidireccional.
Con fileUrl, la API reproduce el archivo cuando se atiende la llamada y
finaliza la llamada al terminar el audio. Se aceptan MP3, WAV y OGG/Opus por
URL HTTP(S), data URI o base64, con un límite de 25 MB.
Opcional: Use call_duration para definir durante cuántos segundos debe sonar la llamada.
Tras ese período la llamada se finaliza automáticamente, sin necesidad de llamar a /call/reject.
Use 0 para no limitar la reproducción del audio por tiempo.
Ejemplo de solicitud:
{
"number": "5511999999999",
"call_duration": 0,
"fileUrl": "https://exemplo.com/audio.mp3"
}
Ejemplo de respuesta:
{
"response": "Call request accepted locally, awaiting WhatsApp confirmation",
"confirmed": false,
"audio": {
"requested": true,
"playback": "starts_when_call_is_ready"
}
}
Errores comunes:
- 401: Token inválido o expirado
- 400: Número inválido o ausente
- 500: Error al iniciar la llamada
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": "Solicitud de llamada aceptada localmente, esperando confirmación de WhatsApp",
"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"
}
}Autorizaciones
Cuerpo
Número del contacto en formato internacional (ej.: 5511999999999)
"5511999999999"
Duración máxima de la llamada en segundos. Use 0 u omítalo para no limitar el audio por tiempo.
x >= 015
Audio MP3, WAV u OGG/Opus por URL HTTP(S), data URI o base64, de hasta 25 MB. La reproducción comienza cuando se contesta la llamada.
"https://exemplo.com/audio.mp3"
Respuesta
Llamada iniciada correctamente
Mensaje de confirmación
"Solicitud de llamada aceptada localmente, esperando confirmación de WhatsApp"
Indica si la llamada ya fue confirmada por WhatsApp en la respuesta inicial
false
Metadatos de la llamada creada
Show child attributes
Show child attributes
Presente cuando se informó fileUrl
Show child attributes
Show child attributes
