Comment

Version 2019-10

A comment is a reader's response to an article in a blog. Comments appear on the article page in reverse chronological order, typically after the article body. Just as a blog can have any number of articles, an article can have any number of comments.

Article comments are a target for spammers, so Shopify blogs use a spam detection system to identify comments that are likely to be spam. Shop owners can also can mark comments as spam or not spam. Comments that are marked as spam are removed from the Shopify admin and don't appear in the blog.

What you can do with Comment

The Shopify API lets you do the following with the Comment resource. More detailed versions of these general actions may be available:

Comment properties

article_id
"article_id": 134645308

A unique numeric identifier for the article that the comment belongs to.

author
"author": "Soleone"

The name of the author of the comment.

blog_id
"blog_id": 241253187

A unique numeric identifier for the blog containing the article that the comment belongs to.

body
"body": "This is a _great_ article."

The basic Textile markup of a comment.

body_html
"body_html": "<p>This is a <em>great</em> article.</p>"

The text of the comment, complete with HTML markup.

created_at
read-only
"created_at": "2012-08-24T14:01:46-04:00"

The date and time (ISO 8601 format) when the comment was created.

email
"email": "sole@one.de"

The email address of the author of the comment.

id
read-only
"id": 653537639

A unique numeric identifier for the comment.

ip
"ip": "127.0.0.1"

The IP address from which the comment was posted.

published_at
"published_at": "2012-08-24T14:02:00-04:00"

The date and time (ISO 8601 format) when the comment was published.

status
read-only
"status": "unapproved"

The status of the comment. Valid values:

  • pending: The comment has been created but is awaiting spam detection. Depending on the result of the spam detection and the shop owner's comment preferences, this property will be transitioned to either spam, unapproved, or approved.
  • unapproved (default): The comment is awaiting approval by the shop owner. It's not visible to the readers of the blog.
  • published: The comment has been approved (if the blog requires comments to be approved) and is visible to readers of the blog.
  • spam: The comment has been marked as spam and removed from the Shopify admin. It's not visible to readers of the blog.
  • removed: The comment has been removed by the shop owner. It's not visible to readers of the blog.

updated_at
read-only
"updated_at": "2012-08-24T14:02:00-04:00"

The date and time (ISO 8601 format) when the comment was last modified. When the comment is created, this matches the value of created_at. If the blog requires comments to be approved, then this value is updated to the date and time when the comment is approved.

user_agent
"user_agent": "Mozilla/5.0"