Retrieve

View as Markdown

Use this endpoint for the Media method to retrieve a single media record.

A media object can be returned in several representations:

  • Direct Media: Without specifying an extension, the media is returned directly using the mime-type detected.

  • JSON: By appending .json to the media URL, the JSON representation of the media will be returned.


Path parameters

AccountSidstringRequiredformat: "uuid"
The unique identifier of the project that sent or received this message.
MessageSidstringRequiredformat: "uuid"
A unique ID that identifies this specific message.
SidstringRequiredformat: "uuid"
A unique ID that identifies this specific message.

Response

account_sidstringRequiredformat: "uuid"
The unique identifier for the account.
content_typestringRequired
The content type of the media.
date_createdstringRequired
The date, in RFC 2822 GMT format, this media was created.
date_updatedstringRequired
The date, in RFC 2822 GMT format, this media was updated.
parent_sidstringRequiredformat: "uuid"
The unique identifier for the message.
sidstringRequiredformat: "uuid"
The unique identifier for the media.
uristringRequired
The URI for the media.
Response
1{
2 "account_sid": "ea108133-d6b3-407c-9536-9fad8a929a6a",
3 "content_type": "image/jpeg",
4 "date_created": "Mon, 13 Aug 2018 21:38:46 +0000",
5 "date_updated": "Mon, 13 Aug 2018 21:38:46 +0000",
6 "parent_sid": "0a059168-ead0-41af-9d1f-343dae832527",
7 "sid": "b3877c40-da60-4998-90ad-b792e98472me",
8 "uri": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527/Media/b3877c40-da60-4998-90ad-b792e98472me.json"
9}

Request examples

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.messages('MessageSid')
5 .media('MediaSid')
6 .fetch()
7 .then(media => console.log(media.contentType))
8 .done();