How to get the comments data added in the document in onlyoffice document editor?

I need to save the comment made on the document in the database but I am finding no way to get the comment text/data after the comment is made, no events/methods related to it. I found nothing in the document server tab. However, there is something related to this on the community server tab ONLYOFFICE Api Documentation - Add a message comment

But I don’t know how to use this or link this to my current document server or even if it’s useful. What’s the way to do this?

Hello @bipana.shrestha
Please clarify what you mean by ‘save the comment made on the document in the database’. Usually we don’t recommend any manual actions with Document server database.
About situation in general, your mentioned link is related to Community Server API. For commenting please check it out: ONLYOFFICE Api Documentation - Commenting
If I misunderstood your request, please clarify it.

Hey, @Alexandre thank you for the reply. What I mean by ‘save the comment made on the document in the database’ is saving the comments made in the document in our database in our server so that we can display it somewhere in our app outside the editor, or use it for some task outside the editor.

I realize the link I sent is related to Community Server API. I was asking if it can be used for getting comments data made via document server API. So I guess there can be no such integrations?

You can get all the comments from the document using Document Builder:

Here’s documentation on how to use the Document Builder that is available inside the Document Server: