Get a WhatsApp file
/v1/whatsapp/files/{file_id}const file = await bird.whatsapp.files.get("waf_01kyb2m4xq7whs0d8n3prv6tez");
// Send it from file.from before expires_at, as file_id on a media send.
console.log(file.name, file.mime_type, file.from, file.expires_at);file = client.whatsapp.files.get("waf_01kyb2m4xq7whs0d8n3prv6tez")
# Only a message from file.from_ can send it, until expires_at.
print(file.name, file.mime_type, file.size, file.expires_at)file, err := client.Whatsapp.Files.Get(context.Background(), "waf_01kyb2m4xq7whs0d8n3prv6tez")
if err != nil {
log.Fatal(err)
}
fmt.Println(file.Name, file.MimeType, file.Size, file.ExpiresAt)$file = $bird->whatsapp->files->get('waf_01kyb2m4xq7whs0d8n3prv6tez');
// Only a message from getFrom() can send it, until getExpiresAt().
echo $file->getName(), ' ', $file->getMimeType(), ' ', $file->getFrom(), ' ', $file->getExpiresAt()?->format(DATE_ATOM), "\n";bird whatsapp files get <file-id>curl -X GET "https://us1.platform.bird.com/v1/whatsapp/files/{file_id}" \
-H "Authorization: Bearer $TOKEN"{
"id": "waf_01krdgeqcxet5s7t44vh8rt9mg",
"from": "+13124495648",
"name": "receipt.pdf",
"mime_type": "application/pdf",
"size": 48213,
"created_at": "2026-12-03T12:00:00Z",
"expires_at": "2027-01-02T12:00:00Z"
}
Returns a file stored for the workspace's WhatsApp messages with POST /v1/whatsapp/files, with the number it
can be sent from. An unknown ID, an ID from another workspace, the ID of media on a received message, a file
WhatsApp refused at upload, or a file past its 30-day expiry returns 404.
पैरामीटर
file_idstringID of the WhatsApp file.
Response Payload
idID of the stored file, which a free-form media send or a template's media header accepts as file_id.
fromThe E.164 number the file was uploaded to WhatsApp with; only a message from this number can send it.
nameDisplay filename.
mime_typeMedia type of the file.
sizeFile size in bytes.
created_atWhen the file was stored.
expires_atWhen the file is removed, 30 days after it was stored. A send within 24 hours of this time is refused.
संबंधित संसाधन
इस विषय के लिए दस्तावेज़, गाइड और उदाहरणों के साथ आगे बढ़ें।