Get an SMS message's media
/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);media = client.sms.messages.media(
"sms_01kya19eknftrs2s6p82asmvnh", "smf_01kyb2m4xq7whs0d8n3prv6tez"
)
print(media.content_type, media.content_length)media, err := client.Sms.Messages.Media(context.Background(),
"sms_01kya19eknftrs2s6p82asmvnh", "smf_01kyb2m4xq7whs0d8n3prv6tez")
if err != nil {
log.Fatal(err)
}
fmt.Println(media.ContentType, media.ContentLength)$media = $bird->sms->messages->media('sms_01krdgeqcxet5s7t44vh8rt9mg', 'smf_01krdgeqcxet5s7t44vh8rt9mg');
echo $media->contentType, ' ', $media->contentLength;bird sms media <message-id> <media-id>curl -L -X GET "https://us1.platform.bird.com/v1/sms/messages/{message_id}/media/{media_id}" \
-H "Authorization: Bearer $TOKEN"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.
पैरामीटर
message_idstringSMS message ID.
media_idstringMedia ID, as returned in id on the message's media entry.
संबंधित संसाधन
इस विषय के लिए दस्तावेज़, गाइड और उदाहरणों के साथ आगे बढ़ें।