curl --request POST \
--url https://api.wppfy.com/message/download \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "7EB0F01D7244B421048F0706368376E0",
"return_base64": false,
"generate_mp3": true,
"return_link": true,
"transcribe": false,
"openai_apikey": "sk-...",
"download_quoted": false
}
'import requests
url = "https://api.wppfy.com/message/download"
payload = {
"id": "7EB0F01D7244B421048F0706368376E0",
"return_base64": False,
"generate_mp3": True,
"return_link": True,
"transcribe": False,
"openai_apikey": "sk-...",
"download_quoted": False
}
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({
id: '7EB0F01D7244B421048F0706368376E0',
return_base64: false,
generate_mp3: true,
return_link: true,
transcribe: false,
openai_apikey: 'sk-...',
download_quoted: false
})
};
fetch('https://api.wppfy.com/message/download', 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/message/download",
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([
'id' => '7EB0F01D7244B421048F0706368376E0',
'return_base64' => false,
'generate_mp3' => true,
'return_link' => true,
'transcribe' => false,
'openai_apikey' => 'sk-...',
'download_quoted' => false
]),
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/message/download"
payload := strings.NewReader("{\n \"id\": \"7EB0F01D7244B421048F0706368376E0\",\n \"return_base64\": false,\n \"generate_mp3\": true,\n \"return_link\": true,\n \"transcribe\": false,\n \"openai_apikey\": \"sk-...\",\n \"download_quoted\": false\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/message/download")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"7EB0F01D7244B421048F0706368376E0\",\n \"return_base64\": false,\n \"generate_mp3\": true,\n \"return_link\": true,\n \"transcribe\": false,\n \"openai_apikey\": \"sk-...\",\n \"download_quoted\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/download")
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 \"id\": \"7EB0F01D7244B421048F0706368376E0\",\n \"return_base64\": false,\n \"generate_mp3\": true,\n \"return_link\": true,\n \"transcribe\": false,\n \"openai_apikey\": \"sk-...\",\n \"download_quoted\": false\n}"
response = http.request(request)
puts response.read_body{
"mimetype": "audio/mpeg",
"fileURL": "https://api.exemplo.com/files/arquivo.mp3",
"base64Data": "UklGRkj...",
"transcription": "Transcribed text"
}{
"error": "Unsupported media type or no media found in message"
}{
"error": "Invalid token"
}{
"error": "Message not found"
}{
"error": "Failed to download media"
}Download file from a message
Downloads the file associated with a media message (image, video, audio, document, or sticker).
Parameters
- id (string, required): Message ID
- return_base64 (boolean, default: false): Includes the file in base64. Avoid this option because it increases memory usage, processing, and response size. Future versions may limit base64 for files larger than 5 MB.
- generate_mp3 (boolean, default: true): For audio, defines the return format
true: Returns MP3false: Returns OGG
- return_link (boolean, kept for compatibility): The response includes the public URL of the file
- transcribe (boolean, default: false): Transcribes audio to text
- openai_apikey (string, optional): OpenAI key for transcription
- If not provided, uses the key saved in the instance
- If provided, updates and saves it in the instance for future calls
- download_quoted (boolean, default: false): Downloads media from the quoted message
- Useful for downloading original content from WhatsApp status
- When a message is a reply to a status, allows downloading the media from the original status
- Contextualization: By downloading the quoted media, you identify the context of the conversation
- Example: If someone replies to a promotion, by downloading the media you will know the question is about that specific promotion
Examples
Download audio as MP3:
{
"id": "7EB0F01D7244B421048F0706368376E0",
"generate_mp3": true
}
Transcribe audio:
{
"id": "7EB0F01D7244B421048F0706368376E0",
"transcribe": true
}
Include the content in base64:
{
"id": "7EB0F01D7244B421048F0706368376E0",
"return_base64": true
}
Download status media (quoted message):
{
"id": "7EB0F01D7244B421048F0706368376E0",
"download_quoted": true
}
Useful when the customer replies to a promotion/status - you download the original media to understand which product/offer they are asking about.
Response
{
"fileURL": "https://api.exemplo.com/files/arquivo.mp3",
"mimetype": "audio/mpeg",
"base64Data": "UklGRkj...",
"transcription": "Texto transcrito"
}
Note:
- By default, audio is returned as MP3 and all downloads include a public URL in
fileURL. - Avoid
return_base64: true: the conversion increases memory and processing usage on the server and produces a larger response. Prefer downloading the file viafileURL. - Future compatibility: base64 return may be limited for files larger than 5 MB. Do not rely on base64 for large files.
- Transcription requires a valid OpenAI key. The key can be configured once in the instance and will be reused automatically.
- Media retention: the file is available on our CDN for 2 days. After that,
fileURLstops working. Call this endpoint again to generate a new URL, as long as the message and the original media are still available. - To keep the media for more than 2 days, download the file via
fileURLand save it in your own storage. Storing only the URL does not extend the retention period.
curl --request POST \
--url https://api.wppfy.com/message/download \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "7EB0F01D7244B421048F0706368376E0",
"return_base64": false,
"generate_mp3": true,
"return_link": true,
"transcribe": false,
"openai_apikey": "sk-...",
"download_quoted": false
}
'import requests
url = "https://api.wppfy.com/message/download"
payload = {
"id": "7EB0F01D7244B421048F0706368376E0",
"return_base64": False,
"generate_mp3": True,
"return_link": True,
"transcribe": False,
"openai_apikey": "sk-...",
"download_quoted": False
}
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({
id: '7EB0F01D7244B421048F0706368376E0',
return_base64: false,
generate_mp3: true,
return_link: true,
transcribe: false,
openai_apikey: 'sk-...',
download_quoted: false
})
};
fetch('https://api.wppfy.com/message/download', 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/message/download",
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([
'id' => '7EB0F01D7244B421048F0706368376E0',
'return_base64' => false,
'generate_mp3' => true,
'return_link' => true,
'transcribe' => false,
'openai_apikey' => 'sk-...',
'download_quoted' => false
]),
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/message/download"
payload := strings.NewReader("{\n \"id\": \"7EB0F01D7244B421048F0706368376E0\",\n \"return_base64\": false,\n \"generate_mp3\": true,\n \"return_link\": true,\n \"transcribe\": false,\n \"openai_apikey\": \"sk-...\",\n \"download_quoted\": false\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/message/download")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"7EB0F01D7244B421048F0706368376E0\",\n \"return_base64\": false,\n \"generate_mp3\": true,\n \"return_link\": true,\n \"transcribe\": false,\n \"openai_apikey\": \"sk-...\",\n \"download_quoted\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/download")
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 \"id\": \"7EB0F01D7244B421048F0706368376E0\",\n \"return_base64\": false,\n \"generate_mp3\": true,\n \"return_link\": true,\n \"transcribe\": false,\n \"openai_apikey\": \"sk-...\",\n \"download_quoted\": false\n}"
response = http.request(request)
puts response.read_body{
"mimetype": "audio/mpeg",
"fileURL": "https://api.exemplo.com/files/arquivo.mp3",
"base64Data": "UklGRkj...",
"transcription": "Transcribed text"
}{
"error": "Unsupported media type or no media found in message"
}{
"error": "Invalid token"
}{
"error": "Message not found"
}{
"error": "Failed to download media"
}Authorizations
Body
ID of the message containing the file
"7EB0F01D7244B421048F0706368376E0"
Includes the content in base64. Avoid for large files; future versions may limit files larger than 5 MB
For audio, defines return format (true=MP3, false=OGG)
Kept for compatibility. The public URL is always returned in fileURL
If true, transcribes audio to text
OpenAI API Key for transcription (optional)
"sk-..."
If true, downloads media from the quoted message instead of the main message
Response
Successful file download
File MIME type
"audio/mpeg"
Public file URL, available for 2 days
"https://api.exemplo.com/files/arquivo.mp3"
File content in base64 (if return_base64=true)
"UklGRkj..."
Transcribed text from audio (if transcribe=true)
"Transcribed text"
