Sign inGet Started

Get an SMS message's media

GET
/v1/sms/messages/{message_id}/media/{media_id}
const media = await bird.sms.messages.media(
  "sms_01kya19eknftrs2s6p82asmvnh",
  "smf_01kyb2m4xq7whs0d8n3prv6tez",
);
console.log(media.contentType, media.contentLength);

Redirects to a short-lived URL for one attachment on a received MMS. This endpoint is what the url on an entry of the message's media points at. The bytes live in object storage and are served straight from there, so they never transit the API.

The response is a 302 whose Location is that pre-authorized storage URL, valid for 15 minutes; your client must follow redirects. The Authorization header must be absent from the request that fetches that URL.

The sms.received webhook can arrive before the message is readable. If this operation returns 404 immediately after that event, retry the same message and media IDs with exponential backoff and a retry deadline. Retain the event for later investigation if the deadline is reached; a 404 alone does not distinguish a delayed message from a missing one.

An attachment is kept for 30 days after the message is received. A 410 means the stored file is gone while the message is still readable: the message still lists the attachment's mime_type and filename, but the bytes cannot be served. Once the message itself expires this operation returns 404.

Parâmetros

message_idstring

SMS message ID.

media_idstring

Media ID, as returned in id on the message's media entry.