Skip to content

Data api resource comments

Yuji Takayama edited this page Jul 10, 2013 · 1 revision

Comments resource

Property Name Type Data Type Database Column Private Read Only Description
author Object Users Y The commenter of this comment.
author.id value unsigned integer mt_comment.comment_commenter_id Y Y The ID of this commenter. If commenter is not a registerd user, this field is empty.
author.displayName value string mt_comment.comment_author Y The display name of this commenter.
author.userpicUrl value string Y The URL of this commenter's userpic. The userpic will be made by UserpicThumbnailSize and UserpicAllowRect settings. If a commenter is not a registered user or a commenter does not set own userpic, will be returned empty string.
entry Object Entries Y The container entry of this comment.
entry.id value unsigned integer mt_entry.entry_id Y The ID of the entry that contains this comment.
blog Object Blogs Y The blog of this comment.
blog.id value unsigned int mt_blog.blog_id Y The ID of the blog that contains this comment.
id value unsigned integer mt_comment.comment_id Y The ID of this comment.
date value iso 8601 datetime mt_comment.comment_created_on Y The creation time for this comment.
body value string mt_comment.comment_text The contents of this comment.
link value string Y The permalink for this comment.
parent value unsigned integer mt_comment.comment_parent_id The ID of the parent of this comment. If this comment is not a reply, will be returned 0.
status value string The publishing status of this comment.
Approved
This comment has been approved.
In the database, comment_visible = 1 and comment_junk_status = 1.
Pending
This comment has not been approved.
In the database, comment_visible = 0 and comment_junk_status = 1.
Spam
This comment has been marked as Spam.
In the database, comment_visible = 0 and comment_junk_status = -1.
updatable value boolean
true
The user who accessed can update this comment.
false
The user who accessed cannot update this comment.
customFields ARRAY CustomFields Y The list of customfields data for this comment.
customFields.basename value string mt_field.field_basename The basename of this customfield.
customFields.value value string The value of this customfield.

Example

{
  "author" : {
    "id" : 1,
    "displayName" : "Yuji Takayama",
    "userpicUrl" : "http://host.domain/mt-static/support/assets_c/userpics/userpic-1-32x32.png"
  },
  "entry" : {
    "id" : 1
  },
  "blog" : {
    "id" : 1
  },
  "id" : 2,
  "date" : "2013-01-11T12:48:12+09:00",
  "body" : "This is a test comment.\nHe he he",
  "link" : "http://host.domain/blog/2012/01/entry.html#comment-2",
  "parent" : 1,
  "status" : "Approved",
  "updatable": true,
  "customFields" : {
    "items" : [
      {
        "basename" : "cf_fields_1",
        "value" : "Test data"
      },
      {
        "basename" : "cf_field_2",
        "value" : "Test data 2"
      }
    ]
  }
}
Clone this wiki locally