REST ClientCompatMessages

list_media

View as MarkdownOpen in Claude

List media items (images, files) attached to a message.

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 Example

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 "page": 0,
5 "page_size": 50,
6 "media_list": [
7 {
8 "account_sid": "ea108133-d6b3-407c-9536-9fad8a929a6a",
9 "content_type": "image/jpeg",
10 "date_created": "Mon, 13 Aug 2018 21:38:46 +0000",
11 "date_updated": "Mon, 13 Aug 2018 21:38:46 +0000",
12 "parent_sid": "0a059168-ead0-41af-9d1f-343dae832527",
13 "sid": "b3877c40-da60-4998-90ad-b792e98472me",
14 "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"
15 }
16 ]
17}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9media = client.compat.messages.list_media("SM...")