Read Comments in Word Document with Nodej.s REST API

This simple topic covers how to read Comments in Word Document with Nodej.s REST API. We will use Aspose.Words for Nodej.s Cloud SDK to read DOCX comments with Nodej.s Low Code API. You will find all the details to configure the development environment and follow the steps and Nodej.s REST API Example Code.

Prerequisite

Steps to Load Word DOC Comments with Nodej.s REST AP

  1. Set Client ID and Client Secret for the API to access the Comments in a Word file
  2. Instantiate an instance of the WordsAPI class with your client account credentials
  3. Create a request to read the comments using an instance of the GetCommentOnlineRequest by providing the file name and comment index
  4. Access the Comment in the Word document online using the GetCommentOnline method
  5. The required Comment will be returned and displayed in the console

The above steps explain the process to access Word documents online with Nodej.s REST API. We will commence by initializing the WordsApi object using the ClientSecret and ClientId, creating the GetCommentOnlineRequest with the file name and comment index. We will use the GetCommentOnline() method to process the comment request and in response will get the queried Comment class object to process further on our end.

Code to Read DOCX Comments with Nodej.s Low Code API

This example code entails the process to read DOCX comments with Nodej.s REST API. The GetCommentOnlineRequest takes mandatory document name and comment index parameters and exposes optional parameters to set the document file’s load encoding, password, and encryption password. The request processed by GetCommentOnline() will return the Comment object containing information like comment text, author name, author initials, and comment time to name a few.

In this example, we have focused on how to load Word DOC comments with Nodej.s REST API. If you want to delete the Word DOC comments, refer to the article on Delete Comments in Word DOC with Nodej.s REST API.

 English