Create a Message
Post a plain text, rich text or html message, and optionally, a file attachment attachment, to a room.
The files
parameter is an array, which accepts multiple values to allow for future expansion, but currently only one file may be included with the message. File previews are only rendered for attachments of 1MB or less.
html formatting is limited to the following markup h1
,h2
,h3
,ul
,ol
,u
,i
,b
and links.
Body Parameters
The room ID of the message.
The parent message to reply to.
The person ID of the recipient when sending a private 1:1 message.
The email address of the recipient when sending a private 1:1 message.
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. The maximum message length is 7439 bytes.
The message, in Markdown format. The maximum message length is 7439 bytes.
The message, in HTML format. The maximum message length is 7439 bytes.
The public URL to a binary file to be posted into the room. Only one file is allowed per message. Uploaded files are automatically converted into a format that all Webex clients can render. For the supported media types and the behavior of uploads, see the Message Attachments Guide.
Content attachments to attach to the message. Only one card per message is supported. See the Cards Guide for more information.
The content type of the attachment.
Adaptive Card content.
Must be AdaptiveCard
.
Adaptive Card schema version.
The card's elements.
The card's actions.
Response Properties
The unique identifier for the message.
The unique identifier for the parent message.
The room ID of the message.
The type of room.
1:1 room
group room
The person ID of the recipient when sending a private 1:1 message.
The email address of the recipient when sending a private 1:1 message.
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.
The message, in Markdown format.
The text content of the message, in HTML format. This read-only property is used by the Webex clients.
Public URLs for files attached to the message. For the supported media types and the behavior of file uploads, see Message Attachments.
The person ID of the message author.
The email address of the message author.
People IDs for anyone mentioned in the message.
Group names for the groups mentioned in the message.
Message content attachments attached to the message. See the Cards Guide for more information.
The content type of the attachment.
Adaptive Card content.
Must be AdaptiveCard
.
Adaptive Card schema version.
The card's elements.
The card's actions.
The date and time the message was created.
The date and time that the message was last edited by the author. This field is only present when the message contents have changed.
True if the audio file is a voice clip recorded by the client; false if the audio file is a standard audio file not posted using the voice clip feature.
Response Codes
The list below describes the common success and error responses you should expect from the API:
Code | Status | Description |
---|---|---|
200 | OK | Successful request with body content. |
201 | Created | The request has succeeded and has led to the creation of a resource. |
202 | Accepted | The request has been accepted for processing. |
204 | No Content | Successful request without body content. |
400 | Bad Request | The request was invalid or cannot be otherwise served. An accompanying error message will explain further. |
401 | Unauthorized | Authentication credentials were missing or incorrect. |
403 | Forbidden | The request is understood, but it has been refused or access is not allowed. |
404 | Not Found | The 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. |
405 | Method Not Allowed | The request was made to a resource using an HTTP request method that is not supported. |
409 | Conflict | The 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. |
410 | Gone | The requested resource is no longer available. |
415 | Unsupported Media Type | The request was made to a resource without specifying a media type or used a media type that is not supported. |
423 | Locked | The requested resource is temporarily unavailable. A Retry-After header may be present that specifies how many seconds you need to wait before attempting the request again. |
428 | Precondition Required | File(s) cannot be scanned for malware and need to be force downloaded. |
429 | Too Many Requests | Too 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. |
500 | Internal Server Error | Something went wrong on the server. If the issue persists, feel free to contact the Webex Developer Support team. |
502 | Bad Gateway | The server received an invalid response from an upstream server while processing the request. Try again later. |
503 | Service Unavailable | Server is overloaded with requests. Try again later. |
504 | Gateway Timeout | An upstream server failed to respond on time. If your query uses max parameter, please try to reduce it. |
Header
Body
- roomIdstringThe room ID of the message.
- parentIdstringThe parent message to reply to.
- toPersonIdstringThe person ID of the recipient when sending a private 1:1 message.
- toPersonEmailstringThe email address of the recipient when sending a private 1:1 message.
- textstringThe 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. The maximum message length is 7439 bytes.
- markdownstringThe message, in Markdown format. The maximum message length is 7439 bytes.
- htmlstringThe message, in HTML format. The maximum message length is 7439 bytes.
- filesarrayThe public URL to a binary file to be posted into the room. Only one file is allowed per message. Uploaded files are automatically converted into a format that all Webex clients can render. For the supported media types and the behavior of uploads, see the [Message Attachments Guide](/docs/basics#message-attachments).
- attachmentsarrayContent attachments to attach to the message. Only one card per message is supported. See the [Cards Guide](/docs/api/guides/cards) for more information.
{ "roomId": "Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0", "parentId": "Y2lzY29zcGFyazovL3VzL01FU1NBR0UvZWM1ZTIzZjAtN2RhMS0xMWU5LTg2NTgtZTkzYzNiODZjZmFm", "toPersonId": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mMDZkNzFhNS0wODMzLTRmYTUtYTcyYS1jYzg5YjI1ZWVlMmX", "toPersonEmail": "julie@example.com", "text": "PROJECT UPDATE - A new project plan has been published on Box: http://box.com/s/lf5vj. The PM for this project is Mike C. and the Engineering Manager is Jane W.", "markdown": "**PROJECT UPDATE** A new project plan has been published [on Box](http://box.com/s/lf5vj). The PM for this project is <@personEmail:mike@example.com> and the Engineering Manager is <@personEmail:jane@example.com>.", "html": "<h3>I am more than text and less than a Title</h3>", "files": [ "http://www.example.com/images/media.png" ], "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "TextBlock", "text": "Adaptive Cards", "size": "large" } ], "actions": [ { "type": "Action.OpenUrl", "url": "http://adaptivecards.io", "title": "Learn More" } ] } } ] }
{ "id": "Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk", "parentId": "Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk", "roomId": "Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0", "roomType": "group", "toPersonId": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mMDZkNzFhNS0wODMzLTRmYTUtYTcyYS1jYzg5YjI1ZWVlMmX", "toPersonEmail": "julie@example.com", "text": "PROJECT UPDATE - A new project plan has been published om http://example.com/s/lf5vj. The PM for this project is Mike C. and the Engineering Manager is Jane W.", "markdown": "**PROJECT UPDATE** A new project plan has been published on <http://box.com/s/lf5vj>. The PM for this project is <@personEmail:mike@example.com> and the Engineering Manager is <@personEmail:jane@example.com>.", "html": "<p><strong>PROJECT UPDATE</strong> A new project plan has been published <a href=\\\"http://example.com/s/lf5vj\\\" rel=\\\"nofollow\\\">here</a>. The PM for this project is mike@example.com and the Engineering Manager is jane@example.com.</p>", "files": [ "http://www.example.com/images/media.png" ], "personId": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNWIzNjE4Ny1jOGRkLTQ3MjctOGIyZi1mOWM0NDdmMjkwNDY", "personEmail": "matt@example.com", "mentionedPeople": [ "Y2lzY29zcGFyazovL3VzL1BFT1BMRS8yNDlmNzRkOS1kYjhhLTQzY2EtODk2Yi04NzllZDI0MGFjNTM", "Y2lzY29zcGFyazovL3VzL1BFT1BMRS83YWYyZjcyYy0xZDk1LTQxZjAtYTcxNi00MjlmZmNmYmM0ZDg" ], "mentionedGroups": [ "all" ], "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "TextBlock", "text": "Adaptive Cards", "size": "large" } ], "actions": [ { "type": "Action.OpenUrl", "url": "http://adaptivecards.io", "title": "Learn More" } ] } } ], "created": "2015-10-18T14:26:16+00:00", "updated": "2015-10-18T14:27:16+00:00", "isVoiceClip": false }