Skip to main content

Update a direct message

Update the content of a sent direct message.

tip

Only messages sent within the last 24 hours can be updated.

Request

POST: https://[Base URL](/platform-chat-api/base-url)/v4/direct-channel/message/update

Rate limit: 100 requests per second.

Authentication: All server API requests require signature verification. See API request signing.

Request body

Content type: application/json

ParameterTypeRequiredDescription
fromUserIdStringYesOriginal message sender's user ID.
targetIdStringYesOriginal message recipient's user ID.
messageUIDStringYesUnique ID of the original message. Obtainable via message routing (msgUID field) or from message history logs.
contentStringYesUpdated message content, max 128 KB.
  • Built-in types: Pass the JSON content object serialized as a string. See User content message format.
  • Custom types: The format is flexible and not limited to JSON.

Request example

HTTP
POST /v4/direct-channel/message/update HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdsdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7487889a8e711219a47b7cf6a5b000e8
Content-Type: application/json
X-Request-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXX

{
"fromUserId": "user1",
"targetId": "user2",
"messageUID": "5FGT-7VA9-G4DD-4V5P",
"content": "{\"content\":\"updated message text\"}"
}

Response

PropertyTypeDescription
codeNumberStatus code. 0 indicates success.

Response example

HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Request-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXX

{"code":0}