1

Generate Auth Token

Follow these steps to generate and copy your Auth Token.

2

Prepare POST request

Now, prepare a POST API request using the JSON data mentioned below.

Replace your_token_here with the token you copied earlier. Replace your_api_key_here, your_document_id_here and other values with your actual data.

{
    "apiKey": "your_api_key_here",
    "authToken": "your_token_here",
    "documentId": "your_document_id_here",
    "targetElement": {
        "elementId": "element_id", // optional (pass elementId if you want to add comment on a specific element)
        "targetText": "target_text", // optional (pass targetText if you want to add comment on a specific text)
        "occurrence": 1 // optional (default: 1) This is relevant for text comment. By default, we will attach comment to the first occurence of the target text in your document. You can change this to attach your comment on a more specific text.
    },
    "status": "open", // optional (default: open)
    "commentData": [ // an array of comment data. Add additional objects of the same schema for each comment reply in the thread.
        {
            "commentHtml": "This is awesome! Well done.",
            "commentText": "Replace: 'This is old comment' with 'This is new comment'", // required
          	"replaceContentText": "This is new comment", // provide this replaceContentText to replace current text with
            "replaceContentHtml": "<span>This is <b>new</b> comment.</span>", // If replacement text contains html formatted text, then provide it here
            "from": {
                "email": "user1@domain.com", // required
                "name": "User1" // optional
            }
        }
    ]
}
3

b. Send the POST request

Finally, send the POST API request to the https://api.velt.dev/addsystemcomment API endpoint.

If the request is successful, you should receive a 200 OK HTTP status code, along with a response from the server confirming that the comment has been added.

For more information on how to send the POST request, check out the Add System Comments section.

Was this page helpful?