Subir o importar un archivo
curl --request POST \
--url https://api.wegluu.com/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.wegluu.com/v1/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wegluu.com/v1/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "image",
"mime_type": "<string>",
"filename": "<string>",
"byte_size": 123,
"sha256": "<string>",
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}Archivos
Subir o importar un archivo
Sube un archivo (multipart/form-data, campo file) o impórtalo desde una URL pública (JSON con source). Gluu lo valida con los límites de WhatsApp, lo guarda y devuelve un id para enviarlo con "image": { "id": "…" } (u otro tipo) durante 30 días, las veces que quieras.
Límites: imagen JPG o PNG hasta 5 MB; video MP4 o 3GP hasta 16 MB; audio AAC, AMR, MP3, M4A, OGG, WEBM o WAV hasta 16 MB; documento PDF, TXT, Word, Excel o PowerPoint hasta 100 MB; sticker WEBP hasta 500 KB.
Requiere una clave full o send_only.
POST
/
media
Subir o importar un archivo
curl --request POST \
--url https://api.wegluu.com/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.wegluu.com/v1/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wegluu.com/v1/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "image",
"mime_type": "<string>",
"filename": "<string>",
"byte_size": 123,
"sha256": "<string>",
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}Autorizaciones
Cuerpo
multipart/form-dataapplication/json