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
| Parameter | Type | Required | Description |
|---|---|---|---|
fromUserId | String | Yes | Original message sender's user ID. |
targetId | String | Yes | Original message recipient's user ID. |
messageUID | String | Yes | Unique ID of the original message. Obtainable via message routing (msgUID field) or from message history logs. |
content | String | Yes | Updated message content, max 128 KB.
|
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
| Property | Type | Description |
|---|---|---|
code | Number | Status 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}