Post
/api/v1/chat.update
Update a specific message.
Changelog
Version | Description |
---|---|
6.12.0 | Fixed customFields not updating if text was unchanged |
6.4.0 | Add previewUrls param |
0.49.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example
{
"roomId": "64f0f82c2c26843a68c1f7ba",
"msgId": "vzGBzSwy6jJQDwtZe",
"text": "Updated list of links! https://google.com https://hola.org/ https://www.usepayday.com/ https://www.getbumpa.com/ https://www.atlassian.com/software/jira http://localhost:3000/",
"previewUrls": [
"https://google.com",
"http://localhost:3000/"
]
}
object
roomId
string Required
The room ID where the message is.
msgId
string Required
The message ID to update.
text
string Required
Updated text for the message.
previewUrls
Array of string
An array to define which URL previews should be retrieved from each message.
string
customFields
object
You can add custom fields for messages. For example, set priorities for messages.
You must enable this option and define the validation in the workspace settings. See the Message settings for further information.
Example{
"priority": "high"
}
Responses
200
OK
Example
{
"message": {
"_id": "vzGBzSwy6jJQDwtZe",
"rid": "64f0f82c2c26843a68c1f7ba",
"msg": "Updated list of links! https://google.com https://hola.org/ https://www.usepayday.com/ https://www.getbumpa.com/ https://www.atlassian.com/software/jira http://localhost:3000/",
"ts": "2023-09-20T17:27:59.945Z",
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie",
"name": "test test"
},
"_updatedAt": "2023-09-20T22:22:45.793Z",
"urls": [
{
"url": "https://google.com",
"meta": {}
},
{
"url": "https://hola.org/",
"meta": {},
"ignoreParse": true
},
{
"url": "https://www.atlassian.com/software/jira",
"meta": {},
"ignoreParse": true
},
{
"url": "http://localhost:3000/",
"meta": {}
}
],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Updated list of links! "
},
{
"type": "LINK",
"value": {
"src": {
"type": "PLAIN_TEXT",
"value": "https://google.com"
},
"label": [
{
"type": "PLAIN_TEXT",
"value": "https://google.com"
}
]
}
},
{
"type": "PLAIN_TEXT",
"value": " "
},
{
"type": "LINK",
"value": {
"src": {
"type": "PLAIN_TEXT",
"value": "https://hola.org/"
},
"label": [
{
"type": "PLAIN_TEXT",
"value": "https://hola.org/"
}
]
}
},
{
"type": "PLAIN_TEXT",
"value": " "
},
{
"type": "LINK",
"value": {
"src": {
"type": "PLAIN_TEXT",
"value": "https://www.atlassian.com/software/jira"
},
"label": [
{
"type": "PLAIN_TEXT",
"value": "https://www.atlassian.com/software/jira"
}
]
}
},
{
"type": "PLAIN_TEXT",
"value": " "
},
{
"type": "LINK",
"value": {
"src": {
"type": "PLAIN_TEXT",
"value": "http://localhost:3000/"
},
"label": [
{
"type": "PLAIN_TEXT",
"value": "http://localhost:3000/"
}
]
}
}
]
}
],
"editedAt": "2023-09-20T22:22:45.737Z",
"editedBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie"
}
},
"success": true
}
object
message
object
_id
string
rid
string
msg
string
ts
string
u
object
_id
string
username
string
name
string
_updatedAt
string
urls
Array of object
object
url
string
meta
object
ignoreParse
boolean
mentions
Array of object
object
channels
Array of object
object
md
Array of object
object
type
string
value
Array of object
object
type
string
value
string
editedAt
string
editedBy
object
_id
string
username
string
success
boolean
400
Bad Request
Example 1
{
"success": false,
"error": "The required \"messageId\" param is missing. [error-messageid-param-not-provided]",
"errorType": "error-messageid-param-not-provided"
}
object
success
boolean
error
string
errorType
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string