Read a list of Media resources associated with a specific Message resource

GET /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json

The Media subresource of a Message resource represents a piece of media, such as an image, that is associated with the Message.

Read a list of Media resources associated with a specific Message resource

Path parameters

  • AccountSid string Required

    The SID of the Account that is associated with the Media resources.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

  • MessageSid string Required

    The SID of the Message resource that is associated with the Media resources.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^(SM|MM)[0-9a-fA-F]{32}$.

Query parameters

  • DateCreated string(date-time)

    Only include Media resources that were created on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read Media that were created on this date. You can also specify an inequality, such as StartTime<=YYYY-MM-DD, to read Media that were created on or before midnight of this date, and StartTime>=YYYY-MM-DD to read Media that were created on or after midnight of this date.

  • DateCreated< string(date-time)

    Only include Media resources that were created on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read Media that were created on this date. You can also specify an inequality, such as StartTime<=YYYY-MM-DD, to read Media that were created on or before midnight of this date, and StartTime>=YYYY-MM-DD to read Media that were created on or after midnight of this date.

  • DateCreated> string(date-time)

    Only include Media resources that were created on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read Media that were created on this date. You can also specify an inequality, such as StartTime<=YYYY-MM-DD, to read Media that were created on or before midnight of this date, and StartTime>=YYYY-MM-DD to read Media that were created on or after midnight of this date.

  • PageSize integer(int64)

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

  • Page integer

    The page index. This value is simply for client state.

    Minimum value is 0.

  • PageToken string

    The page token. This is provided by the API.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • media_list array[object]
      Hide media_list attributes Show media_list attributes object
      • account_sid string | null

        The SID of the Account associated with this Media resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • content_type string | null

        The default MIME type of the media, for example image/jpeg, image/png, or image/gif.

      • date_created string(date-time-rfc-2822) | null

        The date and time in GMT when this Media resource was created, specified in RFC 2822 format.

      • date_updated string(date-time-rfc-2822) | null

        The date and time in GMT when this Media resource was last updated, specified in RFC 2822 format.

      • parent_sid string | null

        The SID of the Message resource that is associated with this Media resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^(SM|MM)[0-9a-fA-F]{32}$.

      • sid string | null

        The unique string that identifies this Media resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ME[0-9a-fA-F]{32}$.

      • uri string | null

        The URI of this Media resource, relative to https://api.twilio.com.

    • end integer
    • first_page_uri string(uri)
    • next_page_uri string(uri) | null
    • page integer
    • page_size integer
    • previous_page_uri string(uri) | null
    • start integer
    • uri string(uri)
GET /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json
curl \
 --request GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media.json' \
 --user "username:password"
Response examples (200)
{
  "end": 0,
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0",
  "page": 0,
  "start": 0,
  "total": 1,
  "num_pages": 1,
  "page_size": 50,
  "media_list": [
    {
      "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
      "parent_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "content_type": "image/jpeg",
      "date_created": "Sun, 16 Aug 2015 15:53:54 +0000",
      "date_updated": "Sun, 16 Aug 2015 15:53:55 +0000"
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0",
  "next_page_uri": null,
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0",
  "previous_page_uri": null
}
{
  "end": 0,
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0",
  "page": 0,
  "start": 0,
  "total": 1,
  "num_pages": 1,
  "page_size": 50,
  "media_list": [],
  "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0",
  "next_page_uri": null,
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0",
  "previous_page_uri": null
}