AddReply
function AddReply(
sText: String = null,
sAuthorName: String = null,
sUserId: String = null,
nPos: Number = this.GetRepliesCount(),
): ApiComment
Description
Adds a reply to a comment.
Parameters
- sText
String
null The comment reply text (required).
- sAuthorName
String
null The name of the comment reply author (optional).
- sUserId
String
null The user ID of the comment reply author (optional).
- nPos
Number
this.GetRepliesCount() The comment reply position.
Returns
ApiComment
Try It
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is just a sample text");
Api.AddComment(oParagraph, "comment", "John Smith");
var aComments = oDocument.GetAllComments();
aComments[0].AddReply("reply1", "Mark Potato", "uid-2", 0);