Skip to content

List blog comments

GET
/stores/{storeRef}/blog/comments
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/stores/example/blog/comments?filters=%5B%7B%22field%22%3A%22is_approved%22%2C%22operator%22%3A%22is%22%2C%22values%22%3A%5B%22false%22%5D%7D%5D&sort_order=asc' \
--header 'x-api-key: <x-api-key>'

Returns comments on all of the store’s posts, newest first by default, each with the title of its post. Filter by approval state, post or text, or pass filters for list-view filters. Paginated with limit (default 20) and offset.

Required scopes: read:blog

storeRef
required
string

The store’s ref, as returned by GET /stores.

is_approved
boolean

Return only approved (true) or only pending (false) comments.

post_id
number

Return only comments on the post with this ID.

search
string

Free-text search over commenter name, email and comment text.

limit
number

Maximum number of comments to return. Defaults to 20.

offset
number

Number of comments to skip. Defaults to 0.

filters
string

Example

[{"field":"is_approved","operator":"is","values":["false"]}]

Admin list-view filters, a JSON array of {field, operator, values}. At most 10 clauses, at most 50 values each.

sort_by
string

Sort field

sort_order
string
Allowed values: asc desc

Sort direction.

Media typeapplication/json
object
data
required
Array<object>
object
id
required

Comment ID.

number
blog_post_id
required

ID of the post the comment belongs to.

number
nullable
parent_comment_id
required

ID of the comment this one replies to, or null for a top-level comment.

number
nullable
author_name
required

Name of the commenter.

string
author_email
required

Email of the commenter.

string
author_website

Website of the commenter, or null.

string
nullable
content
required

Comment text.

string
is_approved

Whether the comment is approved and visible on the storefront.

boolean
nullable
created_at

When the comment was created, as an ISO 8601 timestamp.

string
nullable
post_title

Title of the post the comment belongs to. Present on the store-wide comment list only.

string
nullable
meta
required
object
total
required

Total number of items matching the request.

number
limit
required

Maximum number of items in this page.

number
offset
required

Number of items skipped before this page.

number
page
required

Current page number, starting at 1.

number
totalPages
required

Total number of pages.

number
hasNext
required

Whether a next page exists.

boolean
hasPrev
required

Whether a previous page exists.

boolean

Example generated

{
"data": [
{
"id": 1,
"blog_post_id": 1,
"parent_comment_id": 1,
"author_name": "example",
"author_email": "example",
"author_website": "example",
"content": "example",
"is_approved": true,
"created_at": "example",
"post_title": "example"
}
],
"meta": {
"total": 1,
"limit": 1,
"offset": 1,
"page": 1,
"totalPages": 1,
"hasNext": true,
"hasPrev": true
}
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}