Edit a Message

Update a message you have posted not more than 10 times.

Specify the messageId of the message you want to edit.

Please note edits of messages containing files or attachments are not currently supported. If a user attempts to edit a message containing files or attachments a 400 Bad Request will be returned by the API with a message stating that the feature is currently unsupported.

There is also a maximum number of times a user can edit a message. The maximum currently supported is 10 edits per message. If a user attempts to edit a message greater that the maximum times allowed the API will return 400 Bad Request with a message stating the edit limit has been reached.

While only the roomId and text or markdown attributes are required in the request body, a common pattern for editing message is to first call GET /messages/{id} for the message you wish to edit and to then update the text or markdown attribute accordingly, passing the updated message object in the request body of the PUT /messages/{id} request. When this pattern is used on a message that included markdown, the html attribute must be deleted prior to making the PUT request.

PUT/v1/messages/{messageId}
URI Parameters
messageId
stringrequired

The unique identifier for the message.

Body Parameters
roomId
string

The room ID of the message.

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. The maximum message length is 7439 bytes.

markdown
string

The message, in Markdown format. If this attribute is set ensure that the request does NOT contain an html attribute.

Response Properties
id
string

The unique identifier for the message.

parentId
string

The unique identifier for the parent message.

roomId
string

The room ID of the message.

roomType
enum

The type of room.

direct

1:1 room

group

group room

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.

html
string

The text content of the message, in HTML format. This read-only property is used by the Webex clients.

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.

mentionedPeople
array

People IDs for anyone mentioned in the message.

mentionedGroups
array

Group names for the groups mentioned in the message.

attachments
array

Message content attachments attached to the message. See the Cards Guide for more information.

contentType
string

The content type of the attachment.

content
Adaptive Card

Adaptive Card content.

created
string

The date and time the message was created.

updated
string

The date and time that the message was last edited by the author. This field is only present when the message contents have changed.

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.
410GoneThe requested resource is no longer available.
415Unsupported Media TypeThe request was made to a resource without specifying a media type or used a media type that is not supported.
423LockedThe 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.
428Precondition RequiredFile(s) cannot be scanned for malware and need to be force downloaded.
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.
504Gateway TimeoutAn upstream server failed to respond on time. If your query uses max parameter, please try to reduce it.
PUT
/v1/messages/
Log in to try the API.
Header
Body
  • The room ID of the 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. If this attribute is set ensure that the request does NOT contain an `html` attribute.
https://webexapis.com/v1/messages/Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk
{
  "roomId": "Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0",
  "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>."
}
200 / OK
{
  "id": "Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk",
  "parentId": "Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk",
  "roomId": "Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0",
  "roomType": "group",
  "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": "<p><strong>PROJECT UPDATE</strong> A new project plan has been published <a href=\\\"http://box.com/s/lf5vj\\\" rel=\\\"nofollow\\\">on Box</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"
}