Retrieve a media URL
GET
/{media_id}Returns a temporary download link for a file, plus its type, size and checksum.
Fetch the url with your apikey header, as shown in Download media from its URL. The link expires after 5 minutes; call this again for a fresh one. To skip this step, use Download media.
Authorization
apiKey apikey<token>
Your HostMentor API key, from the dashboard under Messaging → WhatsApp → API keys.
In: header
Path Parameters
media_id*string
ID of the file, from Upload media or an incoming message webhook.
Query Parameters
phone_number_id*string
ID of your WhatsApp number that uploaded or received the file.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://wa.hostmentor.com/v3/1166846181421424?phone_number_id=106540352242922" \ -H "apikey: YOUR_API_KEY"{ "url": "https://wa.hostmentor.com/v3/whatsapp_business/attachments/?mid=1166846181421424&ext=1790506200&hash=ATtFkAs7t1xlhx9wik43m7NBRARfMzfh6Vi_IvgzzxkQsQ", "mime_type": "image/jpeg", "sha256": "ee490eac2a7b038413ab2fb0bfc6db02d9a68e015d92e917fbcee9e324a96810", "file_size": 436484, "id": "1166846181421424", "messaging_product": "whatsapp"}