List Direct Messages

Lists all messages in a 1:1 (direct) room. Use the personId or personEmail query parameter to specify the room. Each message will include content attachments if present.

The list sorts the messages in descending order by creation date.

GET/v1/messages/direct
Query Parameters
Name
Description
personId
string

List messages in a 1:1 room, by person ID.

personEmail
string

List messages in a 1:1 room, by person email.

Response Properties
Name
Description
id
string

The unique identifier for the message.

roomId
string

The room ID of the message.

roomType
string

The type of room. Will always be direct.

text
string

The message, in plain text. If markdown is specified this parameter may be optionally used to provide alternate text for UI clients that do not support rich text.

markdown
string

The message, in Markdown format.

files
array

Public URLs for files attached to the message. For the supported media types and the behavior of file uploads, see Message Attachments.

personId
string

The person ID of the message author.

personEmail
string

The email address of the message author.

created
string

The date and time the message was created.

Response Codes

The list below describes the common success and error responses you should expect from the API.

CodeStatusDescription
200OKSuccessful request with body content.
204No ContentSuccessful request without body content.
400Bad RequestThe request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401UnauthorizedAuthentication credentials were missing or incorrect.
403ForbiddenThe request is understood, but it has been refused or access is not allowed.
404Not FoundThe URI requested is invalid or the resource requested, such as a user, does not exist. Also returned when the requested format is not supported by the requested method.
405Method Not AllowedThe request was made to a resource using an HTTP request method that is not supported.
409ConflictThe request could not be processed because it conflicts with some established rule of the system. For example, a person may not be added to a room more than once.
415Unsupported Media TypeThe request was made to a resource without specifying a media type or used a media type that is not supported.
429Too Many RequestsToo many requests have been sent in a given amount of time and the request has been rate limited. A Retry-After header should be present that specifies how many seconds you need to wait before a successful request can be made.
500Internal Server ErrorSomething went wrong on the server. If the issue persists, feel free to contact the Webex Developer Support team.
502Bad GatewayThe server received an invalid response from an upstream server while processing the request. Try again later.
503Service UnavailableServer is overloaded with requests. Try again later.
GET
/v1/messages/direct{?personId,personEmail}
Log in to try the API.
Header
Query Parameters
  • List messages in a 1:1 room, by person ID.
  • List messages in a 1:1 room, by person email.
https://api.ciscospark.com/v1/messages?personId=Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNWIzNjE4Ny1jOGRkLTQ3MjctOGIyZi1mOWM0NDdmMjkwNDY&personEmail=matt@example.com
{
  "items": [
    {
      "id": "Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk",
      "roomId": "Y2lzY29zcGFyazovL3VzL1JPT00vODQxZjY5MjAtNDdlZC00NmE0LWI2YmItZTVjM2M1YTc3Yzgy",
      "roomType": "direct",
      "text": "Hey there, what do you think of this project update presentation (http://sharepoint.example.com/presentation.pptx)?",
      "markdown": "Hey there, what do you think of [this project update presentation](http://sharepoint.example.com/presentation.pptx)?",
      "files": [
        "http://www.example.com/images/media.png"
      ],
      "personId": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNWIzNjE4Ny1jOGRkLTQ3MjctOGIyZi1mOWM0NDdmMjkwNDY",
      "personEmail": "matt@example.com",
      "created": "2015-10-18T14:26:16+00:00"
    }
  ]
}