Getting a feed of a file's comments
Added by IBM contributorIBM | Edited by IBM contributorPaul Bastide on August 13, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Get a feed that lists all of the comments associated with a file.

{document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document and {userid} is the value of the person's <snx:userid>. The current user profile ID can be retrieved accessing the profile service document as documented in Retrieving the Profiles service document.

See Searching for a user's profile for more information.

Request parameters

Use one or more of the input parameters to narrow the search. Separate multiple parameters with an ampersand (&).

Notices

Because commnetId parameter has precedence over the page and sI parameters, the previous and next page links into the returned Atom feed document will not point to the previous and next page, because they will carry over the commentId parameter.

Input
Method URI Description
GET /files/{auth}/api/userlibrary/{userid}/document/{document-id}/feed A feed of comments associated with files to which you have access. You must authenticate this request.
GET /files/{auth}/api/userlibrary/{userid}/document/{document-id}/feed A feed of comments associated with all public files.
Name Type Optional Description
userid
string No The value of the person's <snx:userid>
document-id
string No The value of the <td:uuid> or <td:label> elements in the file's Atom entry document
Name Type Optional Description
category
string No Resource type to include in the response. This parameter should always be set to comment. If you do not specify a category, comment is returned.
commentId
string Yes Returns the page that contains the comment specified by the commentId. This parameter has no effect when the results fit into a single page. If this parameter is passed, page and sI parameters are ignored.
identifier
enumerated Yes Indicates how the document is identified in the {document-id} variable segment of the web address. By default, look up is performed with the expectation that the URL contains the value from the <td:uuid> element of a file Atom entry. Options are uuid and label. Specify label if the URL instead contains the value from the <td:label> element of a file Atom entry.
Authorized values:
  • uuid
  • label
page
int Yes Page number. Specifies the page to be returned. The default value is 1, which returns the first page.
ps
int Yes Page size. Specifies the number of entries to return per page. The default value is 10. The maximum value you can specify is 500.
Note: This parameter replaces the pageSize parameter. The pageSize parameter is supported for backwards compatibility only; it will be deprecated in a future release.
sl
int Yes Start index. Specifies the start index (as a number) in the collection from which the results should be returned. This parameter is ignored if a page parameter or a commentId is provided.
sortBy
enumerated Yes String. Specifies what to sort the returned entries by. Options are:
created
Sorts the entries by the date the item was created.
modified
Sorts the entries by the last modified date.
published
Sorts the entries by the date the item was published (usually related to atom:published element).
updated
Sorts the entries by the last time the item was updated.
The default value of this parameter is modified.
Authorized values:
  • created
  • modified
  • published
  • updated
sortOrder
enumerated Yes Specifies the order in which to sort the results. The options are:
asc
Sorts the results in ascending order.
desc
Sorts the results in descending order.
If a value is specified for the sortBy parameter, but none is specified for this parameter, then this parameter defaults to asc. If neither is specified, this parameter defaults to desc.
Authorized values:
  • asc
  • desc
Output
Content Type: application/atom+xml
Code Description
200
OK. Indicates that the request was received successfully.
401
Unauthorized. Returned when the request has no authentication header and the file is not public or when the authenticated user has no access to the specified file.
400
Bad Request. An invalid or out of bound parameter was passed.
Examples
A sample paginated result of comments feed
GET https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/feed?ps=3

Response returned by the server
<feed xmlns="http://www.w3.org/2005/Atom"
  xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
  xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:td="urn:ibm.com/td" xmlns:thr="http://purl.org/syndication/thread/1.0">
  <generator uri="http://www.ibm.com/xmlns/prod/sn" version="5.0.0.0">IBM Connections - Files</generator>
  <id>urn:lsid:ibm.com:td:213c9b90-1c71-4dc1-a80e-438083b9ac6c</id>
  <link
    href="https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/feed" rel="self"/>
  <title type="text">images.jpg</title>
  <author>
    <name>Frank Adams</name>
    <snx:userid>20547574</snx:userid>
    <snx:orgId>20542369</snx:orgId>
    <snx:orgName>IBM Test - SDK Renovations</snx:orgName>
    <email/>
    <snx:userState>active</snx:userState>
  </author>
  <updated>2014-12-05T13:12:13.821Z</updated>
  <snx:orgId>20542369</snx:orgId>
  <snx:orgName>IBM Test - SDK Renovations</snx:orgName>
  <opensearch:totalResults>9</opensearch:totalResults>
  <link
    href="https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/feed?ps=3&amp;sI=4" rel="next"/>
  <app:collection
    href="https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/feed" xmlns:app="http://www.w3.org/2007/app">
    <title type="text">images.jpg</title>
    <app:accept>application/*</app:accept>
    <app:accept>image/*</app:accept>
    <app:accept>*/*</app:accept>
  </app:collection>
  <entry>
    <id>urn:lsid:ibm.com:td:da512177-4aa4-419c-903a-1681364ae7c8</id>
    <category label="comment" scheme="tag:ibm.com,2006:td/type" term="comment"/>
    <title type="text">Re: images.jpg</title>
    <author>
      <name>Frank Adams</name>
      <snx:userid>20547574</snx:userid>
      <email/>
      <snx:userState>active</snx:userState>
      <snx:orgId>20542369</snx:orgId>
    </author>
    <published>2015-01-06T10:59:36.570Z</published>
    <updated>2015-01-06T10:59:36.570Z</updated>
    <link
      href="https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/da512177-4aa4-419c-903a-1681364ae7c8/entry" rel="self"/>
    <link
      href="https://apps.na.collabserv.com/files/app/file/213c9b90-1c71-4dc1-a80e-438083b9ac6c?comment=da512177-4aa4-419c-903a-1681364ae7c8"
      rel="alternate" type="text/html"/>
    <link
      href="https://apps.na.collabserv.com/files/basic/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/da512177-4aa4-419c-903a-1681364ae7c8/entry" rel="edit"/>
    <link
      href="https://apps.na.collabserv.com/files/basic/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/da512177-4aa4-419c-903a-1681364ae7c8/media" rel="edit-media"/>
    <td:uuid>da512177-4aa4-419c-903a-1681364ae7c8</td:uuid>
    <td:modifier>
      <name>Frank Adams</name>
      <snx:userid>20547574</snx:userid>
      <email/>
      <snx:userState>active</snx:userState>
      <snx:orgId>20542369</snx:orgId>
    </td:modifier>
    <td:modified>2015-01-06T10:59:36.570Z</td:modified>
    <td:created>2015-01-06T10:59:36.570Z</td:created>
    <td:language>en</td:language>
    <td:versionLabel>1</td:versionLabel>
    <td:deleteWithRecord>false</td:deleteWithRecord>
    <content type="text">comment 9</content>
  </entry>
  <entry>
    <id>urn:lsid:ibm.com:td:b637e5f1-1d8b-4cb9-b61a-3e903063f18a</id>
    <category label="comment" scheme="tag:ibm.com,2006:td/type" term="comment"/>
    <title type="text">Re: images.jpg</title>
    <author>
      <name>Frank Adams</name>
      <snx:userid>20547574</snx:userid>
      <email/>
      <snx:userState>active</snx:userState>
      <snx:orgId>20542369</snx:orgId>
    </author>
    <published>2015-01-06T10:59:32.461Z</published>
    <updated>2015-01-06T10:59:32.461Z</updated>
    <link
      href="https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/b637e5f1-1d8b-4cb9-b61a-3e903063f18a/entry" rel="self"/>
    <link
      href="https://apps.na.collabserv.com/files/app/file/213c9b90-1c71-4dc1-a80e-438083b9ac6c?comment=b637e5f1-1d8b-4cb9-b61a-3e903063f18a"
      rel="alternate" type="text/html"/>
    <link
      href="https://apps.na.collabserv.com/files/basic/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/b637e5f1-1d8b-4cb9-b61a-3e903063f18a/entry" rel="edit"/>
    <link
      href="https://apps.na.collabserv.com/files/basic/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/b637e5f1-1d8b-4cb9-b61a-3e903063f18a/media" rel="edit-media"/>
    <td:uuid>b637e5f1-1d8b-4cb9-b61a-3e903063f18a</td:uuid>
    <td:modifier>
      <name>Frank Adams</name>
      <snx:userid>20547574</snx:userid>
      <email/>
      <snx:userState>active</snx:userState>
      <snx:orgId>20542369</snx:orgId>
    </td:modifier>
    <td:modified>2015-01-06T10:59:32.461Z</td:modified>
    <td:created>2015-01-06T10:59:32.461Z</td:created>
    <td:language>en</td:language>
    <td:versionLabel>1</td:versionLabel>
    <td:deleteWithRecord>false</td:deleteWithRecord>
    <content type="text">comment 8</content>
  </entry>
  <entry>
    <id>urn:lsid:ibm.com:td:6c266c72-9432-494d-8b02-a03088e2eb95</id>
    <category label="comment" scheme="tag:ibm.com,2006:td/type" term="comment"/>
    <title type="text">Re: images.jpg</title>
    <author>
      <name>Frank Adams</name>
      <snx:userid>20547574</snx:userid>
      <email/>
      <snx:userState>active</snx:userState>
      <snx:orgId>20542369</snx:orgId>
    </author>
    <published>2015-01-06T10:59:27.761Z</published>
    <updated>2015-01-06T10:59:27.761Z</updated>
    <link
      href="https://apps.na.collabserv.com/files/basic/anonymous/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/6c266c72-9432-494d-8b02-a03088e2eb95/entry" rel="self"/>
    <link
      href="https://apps.na.collabserv.com/files/app/file/213c9b90-1c71-4dc1-a80e-438083b9ac6c?comment=6c266c72-9432-494d-8b02-a03088e2eb95"
      rel="alternate" type="text/html"/>
    <link
      href="https://apps.na.collabserv.com/files/basic/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/6c266c72-9432-494d-8b02-a03088e2eb95/entry" rel="edit"/>
    <link
      href="https://apps.na.collabserv.com/files/basic/api/library/72340930-3547-4a94-8b8c-f19e87283606/document/213c9b90-1c71-4dc1-a80e-438083b9ac6c/comment/6c266c72-9432-494d-8b02-a03088e2eb95/media" rel="edit-media"/>
    <td:uuid>6c266c72-9432-494d-8b02-a03088e2eb95</td:uuid>
    <td:modifier>
      <name>Frank Adams</name>
      <snx:userid>20547574</snx:userid>
      <email/>
      <snx:userState>active</snx:userState>
      <snx:orgId>20542369</snx:orgId>
    </td:modifier>
    <td:modified>2015-01-06T10:59:27.761Z</td:modified>
    <td:created>2015-01-06T10:59:27.761Z</td:created>
    <td:language>en</td:language>
    <td:versionLabel>1</td:versionLabel>
    <td:deleteWithRecord>false</td:deleteWithRecord>
    <content type="text">comment 7</content>
  </entry>
</feed>