API AddComment doesn't add comment to the quoted text

I am having trouble adding a comment via Text Document API (AddComment - ONLYOFFICE Api Documentation). I am trying to add a comment to a specific text using executeMethod. My oCommentData object looks like this:

{
“UserName”: “John Smith”,
“Text”: “comment”,
“QuoteText”: “quote text”,
}

However this does not work, it adds a comment but uses the first word of my document as QuoteText. How do I fix this?

Hello @Vik

Try selecting the word with cursor and then adding the comment. If it is not quite what you are looking for, please provide more details about the result you’d like to achieve.