Streamline document discussions with Instant Comments
Types
This section explains how to use type declarations in Instant JSON records.
The optional keys are specified as follows:
{ optionalKey?: value; }To reduce payload size, omit optional keys when their values are undefined.
Comments
The Instant Comments component enables users to collaborate on and discuss parts of a document in real time. You can use the Document Engine comments APIs to add and retrieve comments in a document.
In Document Engine 1.19.0 and later, Instant JSON exports include createdBy, updatedBy, and group metadata on comments. These fields describe the exported record for filtering and collaboration permissions, but they don’t assign ownership or groups when imported.
// Example of an Instant JSON schema including a comment associated with the annotation identified by `rootId`:{ "type": "pspdfkit/comment", "v": 1, "rootId": "01F46WTF5X3J1WEN6J2YXWHHEW", "pageIndex": 0, "pdfObjectId": null, "creatorName": null, "createdAt": "2021-04-26T10:50:30.650Z", "updatedAt": "2021-04-26T10:50:30.650Z", "text": "This is a comment.", "customData": null}type Comment = { // The comment text. text: string // The name of the comment author. creatorName?: string, // The date of the comment creation. createdAt?: Timestamp, // The date of the last comment update. updatedAt?: Timestamp, // Custom attributes of the comment. customData?: { [key: string]: any }}Annotation Replies aren’t supported in Instant JSON.
For more information about the Instant JSON schema for annotations, refer to the JSON format schema — annotations guide.