TwentyThree Developer APIAPI Method: /api/comment/list

API Method: /api/comment/list

Last updated on August 27, 2015.

Get a list of comments.

Parameters

ParameterDescription
object_id Comments to specific object. This will usually be a photo_id, but can also be an album_id.
object_type Comments to specific object type.
Default: (empty)
Valid value: (empty), photo, album
comment_id Limit to a specific comment.
comment_user_id List comments by a specific user.
search Search through comments.
order Order of the comments in the response (comments are always ordered by creation date).
Default: desc
Valid values: desc and asc
p Page offset for the request. See [pagination](index#pagination) for details.
size Number of objects to include in the response. See [pagination](index#pagination) for details.

Permission level

The minimum required permission level is:

anonymous

To get the email property associated with a comment the required permission level is:

read

Example XML Response

Please note that the XML does not include any extra information about the media and links attached to a comment.

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok" permission_level="read" p="1" size="1" 
  total_count="120" cached="0">

  <comment comment_id="417329" object_id="417254" object_type="photo" 
    user_id="" name="Ernest Hemmingway" email="ernest@example.com" 
    pretty_date="February 26, 2009" pretty_time="08:02 PM" short_date="26. Feb" comment_time="50.4"
    truncated_name="Ernest Hemmingway" creation_date_ansi="2009-02-26 20:02:06">
        <content_text> (plain text version of the comment) </content_text>
        <content> (html version of the comment) </content>
    </comment>
</response>

Example JSON Response

{
  "status": "ok", 
  "permission_level":"read",
  "cached":"0",
  "comments":
    [{
     "comment_id": "417285", "object_id": "417254", 
     "object_type": "photo", "user_id": "", "name": "Lasse", 
     "email": "Lasse@24by7.dk", "pretty_date": "February 26, 2009", 
     "pretty_time": "04:00 PM", "short_date": "26. Feb", 
     "truncated_name": "Lasse", "creation_date_ansi": "2009-02-26 16:00:58",  "comment_time":"50",
     "object_url": "/photo/417254", 
     "content_text": " (plain text version of the comment) ", 
     "content": " (html version of the comment) ", 
     "media":  [{...}, {...}, {...}]
    }],
  "p": "1",
  "size": "1",
  "total_count": "120",
  "site": { ... },
  "endpoint": "/api/comment/list"
}