List all media
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.
Parameters
Parameter | Description |
---|---|
DateCreated Optional | Only return media created on this particular date, formatted as YYYY-MM-DD in UTC. You can also append < or > to return a range of media. For example, use DateCreated< to return media created on or before midnight of the date, or DateCreated> to return media created on or after midnight of the date. |
PageSize Optional | Specify the number of results to return on a single page. The default page size is 50 and the maximum is 1000. |
Request
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json \
-X GET \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.messages('MessageSid')
.media
.each(media => console.log(media.sid));
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Message;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var media = MediaResource.Read(
pathMessageSid: "MessageSid"
);
foreach(var record in media)
{
Console.WriteLine(record.Sid);
}
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
media = client.messages('MessageSid').media.list()
for record in media:
print(record.sid)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
media = @client.messages('MessageSid').media.list
media.each do |record|
puts record.sid
end
Responses
200 OK
{
"uri": "/api/laml/2010-04-01/Accounts/446e9986-0848-4d46-a617-48793c5f5e07/Messages/3338f508-c98c-45a1-b2e3-1a2c345477a8/Media?Page=0&PageSize=50",
"first_page_uri": "/api/laml/2010-04-01/Accounts/446e9986-0848-4d46-a617-48793c5f5e07/Messages/3338f508-c98c-45a1-b2e3-1a2c345477a8/Media?Page=0&PageSize=50",
"next_page_uri": null,
"previous_page_uri": null,
"page": 0,
"page_size": 50,
"media_list": [
{
"sid": "b51dc3c6-df20-4af6-b774-a99de20d3fd8",
"date_created": "Fri, 15 Jun 2018 17:59:25 +0000",
"date_updated": "Fri, 15 Jun 2018 17:59:25 +0000",
"account_sid": "446e9986-0848-4d46-a617-48793c5f5e07",
"parent_sid": "3338f508-c98c-45a1-b2e3-1a2c345477a8",
"content_type": "image/jpeg",
"uri": "/api/laml/2010-04-01/Accounts/446e9986-0848-4d46-a617-48793c5f5e07/Messages/3338f508-c98c-45a1-b2e3-1a2c345477a8/Media/b51dc3c6-df20-4af6-b774-a99de20d3fd8.json"
}
]
}