How to add commont to any selected text

I want to add commont the text selected by me , but I can’t find an available API. My code is as follows:
var oDocument = Api.GetDocument();
//var oParagraph = oDocument.GetElement(0);
var oRange = oDocument.GetRangeBySelect();
var oRangeParagraph0 = oRange.GetParagraph(0);
oDocument.AddComment(oRangeParagraph0 ,“this is commont content”, “xpc”);

But it doesn’t work
I can’t find the relevant method in the API document,
I want to know how to realize my problem,
Thank you.

Hello @xupengcheng
Sorry for the late reply. Do I understand it right, that you are looking for the way to add comments to a text? Please take a look at this plugin: ONLYOFFICE Api Documentation - Plugin examples
I hope this is what you are looking for. If i misunderstood your request, please clarify it.

Also useful link: ONLYOFFICE Api Documentation - Commenting