List

View as Markdown

Use this endpoint for the Media method to return a paged list of media belonging to this message. The most recent media will appear first.

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.

Query parameters

DateCreatedstringOptional
Only return media created on this particular date, formatted as YYYY-MM-DD in UTC.
DateCreated<stringOptional
Only return media created before this date, formatted as YYYY-MM-DD in UTC.
DateCreated>stringOptional
Only return media created after this date, formatted as YYYY-MM-DD in UTC.
PageintegerOptional>=0Defaults to 0
The page number to retrieve. Default is 0.
PageSizeintegerOptional1-1000Defaults to 50
The number of items per page. Default is 50, maximum is 1000.
PageTokenstringOptional
The token for cursor-based pagination. Must start with 'PA' or 'PB'.

Response

uristringRequired
The URI of the current page.
first_page_uristringRequired
The URI of the first page.
next_page_uristring or nullRequired
The URI of the next page, or null if there are no more pages.
previous_page_uristring or nullRequired
The URI of the previous page, or null if this is the first page.
pageintegerRequired
The current page number.
page_sizeintegerRequired
The number of items per page.
media_listlist of objectsRequired
List of media.
Response
1{
2 "uri": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527/Media?Page=0&PageSize=50",
3 "first_page_uri": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527/Media?Page=0&PageSize=50",
4 "next_page_uri": "string",
5 "previous_page_uri": "string",
6 "page": 0,
7 "page_size": 50,
8 "media_list": [
9 {
10 "account_sid": "ea108133-d6b3-407c-9536-9fad8a929a6a",
11 "content_type": "image/jpeg",
12 "date_created": "Mon, 13 Aug 2018 21:38:46 +0000",
13 "date_updated": "Mon, 13 Aug 2018 21:38:46 +0000",
14 "parent_sid": "0a059168-ead0-41af-9d1f-343dae832527",
15 "sid": "b3877c40-da60-4998-90ad-b792e98472me",
16 "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"
17 }
18 ]
19}

Request examples

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