Fetch a message from the conversation

GET /v1/Conversations/{ConversationSid}/Messages/{Sid}

A Message resource represents a message in a conversation.

Fetch a message from the conversation

Path parameters

  • ConversationSid string Required

    The unique ID of the Conversation for this message.

  • Sid string Required

    A 34 character string that uniquely identifies this resource.

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

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
    • account_sid string | null

      The unique ID of the Account responsible for this message.

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

    • conversation_sid string | null

      The unique ID of the Conversation for this message.

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

    • sid string | null

      A 34 character string that uniquely identifies this resource.

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

    • index integer

      The index of the message within the Conversation. Indices may skip numbers, but will always be in order of when the message was received.

      Default value is 0.

    • author string | null

      The channel specific identifier of the message's author. Defaults to system.

    • body string | null

      The content of the message, can be up to 1,600 characters long.

    • media array | null

      An array of objects that describe the Message's media, if the message contains media. Each object contains these fields: content_type with the MIME type of the media, filename with the name of the media, sid with the SID of the Media resource, and size with the media object's file size in bytes. If the Message has no media, this value is null.

    • attributes string | null

      A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.

    • participant_sid string | null

      The unique ID of messages's author participant. Null in case of system sent message.

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

    • date_created string(date-time) | null

      The date that this resource was created.

    • date_updated string(date-time) | null

      The date that this resource was last updated. null if the message has not been edited.

    • url string(uri) | null

      An absolute API resource API URL for this message.

    • delivery

      An object that contains the summary of delivery statuses for the message to non-chat participants.

    • content_sid string | null

      The unique ID of the multi-channel Rich Content template.

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

GET /v1/Conversations/{ConversationSid}/Messages/{Sid}
curl \
 --request GET 'https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages/{Sid}' \
 --user "username:password"
Response examples (200)
{
  "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "body": "Welcome!",
  "index": 0,
  "links": {
    "channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata",
    "delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts"
  },
  "media": null,
  "author": "system",
  "delivery": {
    "read": "some",
    "sent": "all",
    "total": 2,
    "failed": "none",
    "delivered": "some",
    "undelivered": "none"
  },
  "attributes": "{ \"importance\": \"high\" }",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "content_sid": null,
  "date_created": "2016-03-24T20:37:57Z",
  "date_updated": "2016-03-24T20:37:57Z",
  "participant_sid": null,
  "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}