Delete a comment
Delete list comments or list item comments
swat.deleteComment
Deletes a Comment from a List or List item
Definition
swat.deleteComment(options, onSuccess, onError)
Example
Here's an example of how you can use this API to delete Comments of a specific List or List Item :
// Define the opts
let options = {
comments: [{
"lid":"list-id",
"cid":"comment-id"
}]
}
// Define success callback
let onSuccess = function(commentsObj) {
// Executed when list comments are successfully deleted
console.log("Successfully deleted Comments from the List or List Item", commentsObj);
}
// Define error callback
let onError = function(error) {
// Error is an xhrObject
console.log("Error while deleting Comments from the List or List Item", error);
}
swat.deleteComment(options, onSuccess, onError);
API Parameters
Argument | Type | Description |
---|---|---|
options | object | options is an object with array of List Comment Delete Input |
onSuccess | function | Called when the Comments are successfully deleted. |
onError | function | Called when there is an error while deleting the Comments. |
Success Response
The success response is an Array of Deleted Comments
{
"d": [
{
"lid": "list id",
"cid": "comment id"
}
]
}
Other References
List Comment Delete Input
Object containing params required for deleting a comment
Argument | Type | Description |
---|---|---|
listCommentDeleteDef.lid | string | List id of the comment |
listCommentDeleteDef.cid | string | Comment id to be deleted |
Deleted Comments
Fields in List Comment Response
{
"cid": "System generated comment id",
"lid": "List id for the comment",
"txt": "Comment text",
"via": "set as 'email' if comment received via email",
"cby": "Created by email address",
"uby": "Updated by email address",
"cts": "Created at in milliseconds",
"userinfo": {} // userinfo for the comment adder
}
Argument | Type | Required | Description |
---|---|---|---|
cid | string | Yes | Comment id - system generated guid for the comment |
lid | string | Yes | List id - system generated guid for the list |
via | string | optional | Set as email if comment was received via email, else undefined |
txt | string | Yes | Comment content |
cprops | object | optional | Map of custom fields |
cts | number | Yes | Created time at in milliseconds |
cby | string | Yes | Email address of the user who added the commentDefaults to 1. Quantity included for the action |
userinfo | object | Yes | User info of the comment adder |
userinfo.em | string | Yes | Email address of the adder |
userinfo.fname | string | Yes | First name of the adder |
userinfo.lname | string | Yes | Last name of the adder |
Updated over 1 year ago