GetDocumentComments API¶
Returns all comments attached to a document. Each comment includes the author's user ID, login name, timestamp, and text content.
Endpoint¶
Methods¶
-
GET
/srv.asmx/GetDocumentComments?AuthenticationTicket=...&Path=... -
POST
/srv.asmx/GetDocumentComments(form data) -
SOAP Action:
http://tempuri.org/GetDocumentComments
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
AuthenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
Path |
string | Yes | Full infoRouter path to the document (e.g. /Finance/Reports/Q1-Report.pdf), or a short document ID path (~D{id} or ~D{id}.ext). |
Response¶
Success Response¶
Returns a <response> root element containing a <Comments> child element with one <Comment> element per comment. If the document has no comments, <Comments> is present but empty.
<response success="true" error="">
<Comments>
<Comment AuthorID="7"
AuthorName="jsmith"
CommentDate="2024-03-15T14:30:00.000Z">This report looks good. Approved for distribution.</Comment>
<Comment AuthorID="12"
AuthorName="mwilliams"
CommentDate="2024-04-01T09:15:22.500Z">Please update the executive summary section before the next review.</Comment>
</Comments>
</response>
Comment Element Attributes¶
| Attribute | Description |
|---|---|
AuthorID |
Integer user ID of the comment author. |
AuthorName |
Login name of the comment author. |
CommentDate |
UTC timestamp when the comment was posted, in ISO 8601 format (yyyy-MM-ddTHH:mm:ss.fffZ). Empty string if the date is not set. |
The text content of each <Comment> element is the comment body.
No Comments Response¶
When the document exists but has no comments:
Error Response¶
Required Permissions¶
The calling user must have at least read access to the document.
Example¶
GET Request¶
GET /srv.asmx/GetDocumentComments
?AuthenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/Finance/Reports/Q1-2024-Report.pdf
HTTP/1.1
GET Request (short ID path)¶
GET /srv.asmx/GetDocumentComments
?AuthenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=~D1051
HTTP/1.1
POST Request¶
POST /srv.asmx/GetDocumentComments HTTP/1.1
Content-Type: application/x-www-form-urlencoded
AuthenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&Path=/Finance/Reports/Q1-2024-Report.pdf
SOAP Request¶
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://tempuri.org/">
<soap:Body>
<tns:GetDocumentComments>
<tns:AuthenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:AuthenticationTicket>
<tns:Path>/Finance/Reports/Q1-2024-Report.pdf</tns:Path>
</tns:GetDocumentComments>
</soap:Body>
</soap:Envelope>
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Lists the comments on a document, newest information first.
const root = await call('GetDocumentComments', {
authenticationTicket: ticket,
Path: '/Finance/Reports/Q1.pdf'
});
for (const comment of root.querySelectorAll('Comments > Comment')) {
console.log(comment.getAttribute('AuthorName'),
comment.getAttribute('CommentDate'),
comment.textContent);
}
A document with no comments answers with an empty <Comments /> rather than an error. A comment has
no id: AuthorID and CommentDate together are what
DeleteDocumentComment takes to remove one.
This is the comment list only. The compliance entries written by AddSOXComment and AddISOComment are separate and do not appear here.
Notes¶
-
All comments for the document are returned; there is no filtering or pagination.
-
CommentDatevalues are always in UTC and formatted asyyyy-MM-ddTHH:mm:ss.fffZ. -
Both full infoRouter paths and short document ID paths (
~D{id}or~D{id}.ext) are accepted for thePathparameter. -
To add a comment, use
AddDocumentComment. To delete a specific comment, useDeleteDocumentComment.
Related APIs¶
-
AddDocumentComment - Add a new comment to a document
-
DeleteDocumentComment - Delete a specific comment from a document
-
GetDocument - Get full document metadata and properties
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown, or there is no ticket at all |
4041 |
no document at that path - including a folder path, and one the caller may not see |
HTTP 400 |
a required string parameter was empty; refused by model binding, so there is no error document |
A call with no ticket signs in as the anonymous user, so a document in a library flagged as anonymous can be read without authenticating.
| Error | Description |
|---|---|
[900] Authentication failed |
Invalid or missing authentication ticket. |
[901] Session expired or Invalid ticket |
The ticket has expired or does not exist. |
| Document not found | The specified path does not resolve to an existing document. |
SystemError:... |
An unexpected server-side error occurred. |