Skip to content
Wbiztool

Media API

Get media file API

Get the details and download URL of one file in your media library by its ID. Use it to check a file still exists before you send it.

GEThttps://wbiztool.com/api/v1/media/{media_id}/

Body: Query string, or a JSON body with POST

Replace {media_id} in the path with the id returned by Upload media or List media, for example /api/v1/media/5122/.

Quick example#

curl -G https://wbiztool.com/api/v1/media/5122/ \
  --data-urlencode client_id=12345 \
  --data-urlencode api_key=YOUR_API_KEY

Replace 12345 and YOUR_API_KEY with your own values. See Authentication for where to find them.

Request parameters#

Send client_id and api_key in the query string of a GET request, or as a JSON body in a POST request. If client_id is in the query string, the JSON body is ignored.

Path

media_idintegerrequired

ID of the media file. It must be a whole number; anything else returns an HTML "page not found" response instead of JSON.

Authentication

client_idintegerrequired

Your API Client ID from Settings → API keys.

api_keystringrequired

Your API key from the same page.

Response#

{
  "status": 1,
  "message": "Media file retrieved successfully",
  "data": {
    "id": 5122,
    "file_name": "media_12345_17895804001234.pdf",
    "original_file_name": "invoice-4821.pdf",
    "file_url": "https://wbiztool-static.s3.ap-southeast-1.amazonaws.com/media/org_12345/media_12345_17895804001234.pdf",
    "file_type": "file",
    "file_size": 248312,
    "file_size_display": "242.5 KB",
    "mime_type": "application/pdf",
    "is_image": false,
    "file_extension": "pdf",
    "created_at": "2026-09-16T10:20:31.512934+00:00",
    "modified_at": "2026-09-16T10:20:31.512961+00:00",
    "uploaded_by": "[email protected]"
  }
}
FieldTypeDescription
statusinteger1 on success, 0 if the request failed.
messagestringMedia file retrieved successfully, otherwise the error.
data.idintegerID of the media file.
data.file_namestringName the file is stored under.
data.original_file_namestringThe name the file had when it was uploaded.
data.file_urlstringDirect download URL. Use it as img_url or file_url when sending.
data.file_typestringimage or file.
data.file_sizeintegerSize in bytes.
data.file_size_displaystringReadable size with one decimal, for example 242.5 KB.
data.mime_typestringMIME type, for example application/pdf.
data.is_imagebooleantrue when file_type is image.
data.file_extensionstringLower-case extension of original_file_name, without the dot.
data.created_atstringUpload time, ISO 8601 in UTC with a +00:00 offset.
data.modified_atstringWhen the file record was last changed, in the same format.
data.uploaded_bystring or nullLogin username (usually the email address) of the team member who uploaded the file.

Errors#

Errors also return HTTP 200, with status set to 0:

{ "status": 0, "message": "Media file not found" }

One exception: if media_id isn't a number, the URL doesn't match any endpoint and you get an HTML 404 page instead of JSON.

MessageHow to fix it
client_id is requiredAdd client_id.
api_key is requiredAdd api_key.
client_id must be a valid integerSend client_id as a number.
Invalid API keyCheck the key exists and hasn't been deleted or disabled.
Invalid client_id for this API keyThe key belongs to a different client_id.
Media file not foundNo file with this ID exists in the API key's workspace, or it was deleted.
Error retrieving media file: …Something went wrong on our side. Try again.

Check a file before sending it#

Fetch the file by ID, stop if it no longer exists, then send its file_url: as img_url with msg_type 1 for images, or as file_url with msg_type 2 for anything else.

Send a saved media file
import requests

BASE = "https://wbiztool.com/api/v1"
AUTH = {"client_id": 12345, "api_key": "YOUR_API_KEY"}

result = requests.get(f"{BASE}/media/5122/", params=AUTH, timeout=60).json()
if result["status"] != 1:
    raise SystemExit("Can't use this file: " + result["message"])

media = result["data"]
message = {
    **AUTH,
    "whatsapp_client": 678,
    "country_code": "91",
    "phone": "9876543210",
    "msg": "Here is the document you asked for.",
}
if media["is_image"]:
    message.update(msg_type=1, img_url=media["file_url"])
else:
    message.update(msg_type=2, file_url=media["file_url"], file_name=media["original_file_name"])

print(requests.post(f"{BASE}/send_msg/", json=message, timeout=60).json())

Non-image files such as .doc, .ppt, .csv, .zip, .wav and .mov are delivered with .pdf added to the name, and images over 16 MB fail to send. See Upload media → Upload and send.

Tips#

  • Deleted files return Media file not found, even though their file_url may still download. Check with this endpoint rather than by fetching the URL. Uploaded file URLs are public and permanent; see Upload media → Upload and send.
  • Files are per workspace. A file uploaded in one workspace can't be read with an API key from another.
  • Don't know the ID? Search by name with List media.