Event Set Deleted (Logical Delete)
Use this when you want to delete the contents of an event but still have the event, for example to display that the message was withdrawn, or to keep a reply history if using th…
Use this when you want to delete the contents of an event but still have the event, for example to display that the message was withdrawn, or to keep a reply history if using threaded replies. This will logically delete an event, updating it to set deleted flag = true. It will also cause a REPLACE event to be sent so you can update the event you are currently displaying.
BODY PARAMETERS
- deleted: (required) true to delete the event, false to undelete the event.
- userid: (required) The userid of user who is executing the command. The user must have joined the room first. The user must own the event or have elevated permissions.for future analysis or audit trail purposes.
- permanentifnoreplies: (required) If this is set to true, the command is converted from logical delete to permanent delete automatically if the event has no replies. This is for when you want to permanently delete the event but only if it has no children.
RESPONSE CODES
- 200 | OK : Sweet, sweet success.
- 400 | BadRequest : Something is wrong with your request. View response message and errors list for details.
- 403 | Forbidden : The userid issuing the request is banned from chatting in this room (or is banned globally).
- 405 | MethodBlocked : The method was blocked because it contained profanity and filtermode was set to 'block'.
- 409 | Conflict : The customid of your event is already in use.
- 412 | PreconditionFailed : User must JOIN the room before executing a chat command.
Parameters
Values in the path and query string.
appid path The TalkLabs application ID assigned to your account.
Example:your-app-id roomid path The TalkLabs assigned room ID returned when the room was created.
Example:room-id eventid path The TalkLabs assigned chat event ID.
Deleted query true UserId query The customer defined user ID from your application or identity system.
Example:u-8842 PermanentIfNoReplies query true JSON body
Send as application/json.
{
"deleted": true,
"permanentifnoreplies": false,
"userid": "u-8842"
} Common variations
Historical examples filtered through the current request schema.
Event Set Deleted (Logical Delete)
{
"deleted": true,
"permanentifnoreplies": false,
"userid": "u-8842"
} Flag Message Event As Deleted
This variation uses the endpoint and parameters described above.
Status codes
Every JSON response uses the API result envelope.
200 OK ApiResult 400 Bad Request ApiResult 403 Forbidden ApiResult 404 Not Found ApiResult 500 Internal Server Error ApiResult {
"message": "",
"errors": {},
"data": {
"kind": "chat.executecommand",
"op": "speech",
"room": {
"kind": "chat.room",
"id": "5ec2047286c2921ad07edd39",
"appid": "5ec2038a86c2921ad07edd35",
"ownerid": "u-8842",
"name": "New York City Chat (Post-Moderated)",
"description": "Live from the top of the Empire State Building",
"customtype": "",
"customid": "5th-stand",
"custompayload": "",
"customtags": [],
"customfield1": "",
"customfield2": "",
"enableactions": true,
"enableenterandexit": true,
"open": true,
"inroom": 1,
"added": "2020-05-18T03:43:46.3198116Z",
"whenmodified": "2020-05-18T03:43:46.3198116Z",
"moderation": "post",
"maxreports": 0,
"enableprofanityfilter": true,
"delaymessageseconds": 0
},
"speech": {
"kind": "chat.event",
"id": "5ec204d986c2921ad07edd3d",
"roomid": "5ec2047286c2921ad07edd39",
"body": "Hello, SportsTalk247.com World!↵",
"added": "2020-05-18T03:45:29.3561662Z",
"ts": 637253703293561600,
"eventtype": "speech",
"userid": "userid_abe",
"user": {
"kind": "app.user",
"userid": "userid_abe",
"handle": "HonestAbe",
"handlelowercase": "honestabe",
"displayname": "Abraham Lincoln",
"pictureurl": "https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cg_face%2Cq_auto:good%2Cw_300/MTU5MDUzMTE0Mzk2MTI0OTUy/abraham-lincoln-1809---18652c-sixteenth-president-of-the-united-states-of-america-photo-by-stock-montagestock-montagegetty-images_promo.jpg",
"profileurl": "https://www.biography.com/us-president/abraham-lincoln",
"banned": false
},
"customtype": "",
"customid": null,
"custompayload": "",
"customtags": [],
"customfield1": "",
"customfield2": "",
"replyto": null,
"parentid": "",
"hierarchy": [],
"edited": false,
"deleted": false,
"active": true,
"mutedby": [],
"shadowban": false,
"hashtags": [],
"likecount": 0,
"replycount": 0,
"reactions": [],
"moderation": "na",
"reports": []
},
"action": null
}
}