CLI
curl --request GET \
--url 'https://api.minimo.it/public/v1/media/1234567890123456' \
--header 'Authorization: Bearer {{BEARER_TOKEN}}' \
--output attachmentconst res = await fetch('https://api.minimo.it/public/v1/media/1234567890123456', {
method: 'GET',
headers: {
'Authorization': 'Bearer {{BEARER_TOKEN}}',
},
});
const file = await res.arrayBuffer();
console.log(res.headers.get('content-type'), file.byteLength);import requests
res = requests.get(
'https://api.minimo.it/public/v1/media/1234567890123456',
headers={'Authorization': 'Bearer {{BEARER_TOKEN}}'},
)
open('attachment', 'wb').write(res.content)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimo.it/public/v1/media/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.minimo.it/public/v1/media/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.minimo.it/public/v1/media/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimo.it/public/v1/media/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"status": "FAIL",
"message": "<string>"
}Messages
Download Media
Download a voice note, image, video or document a contact sent you
GET
/
public
/
v1
/
media
/
{id}
CLI
curl --request GET \
--url 'https://api.minimo.it/public/v1/media/1234567890123456' \
--header 'Authorization: Bearer {{BEARER_TOKEN}}' \
--output attachmentconst res = await fetch('https://api.minimo.it/public/v1/media/1234567890123456', {
method: 'GET',
headers: {
'Authorization': 'Bearer {{BEARER_TOKEN}}',
},
});
const file = await res.arrayBuffer();
console.log(res.headers.get('content-type'), file.byteLength);import requests
res = requests.get(
'https://api.minimo.it/public/v1/media/1234567890123456',
headers={'Authorization': 'Bearer {{BEARER_TOKEN}}'},
)
open('attachment', 'wb').write(res.content)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimo.it/public/v1/media/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.minimo.it/public/v1/media/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.minimo.it/public/v1/media/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimo.it/public/v1/media/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"status": "FAIL",
"message": "<string>"
}A
whatsapp.message.received event never carries the file: it carries message.media.providerMediaId. Pass that id
here to get the file itself, with its Content-Type (and the filename in Content-Disposition for documents). You
need no WhatsApp provider credentials.
Permissions
The API key needs the WhatsApp or Transactional permission. Only media received on your own numbers can be downloaded: any other id answers404.Authorizations
Path Parameters
Response
The file. Content-Type is its type; documents also carry Content-Disposition with the filename.
The response is of type file.