Skip to content

Data api comments list

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

Comments: list

Retrieve a list of comments.

Authorization is required if want to include unpublished comments.

Request

HTTP Request

This method accepts GET only.

GET https://your-host/your-mt-api.cgi/v1/sites/{blog_id}/comments

Parameters

Method Parameters

Parameter Type Description
blog_id unsigned integer The blog ID.

Query Parameters

Parameter Type Description
limit unsigned integer This is an optional parameter. Maximum number of comments to retrieve. Default is 10.
offset unsigned integer This is an optional parameter. 0-indexed offset. Default is 0.
includeIds string This is an optional parameter. The comma separated ID list of comments to include to result.
excludeIds string This is an optional parameter. The comma separated ID list of comments to exclude from result.
status string This is an optional parameter. Filter by status.
Approved
comment_visible is 1 and comment_junk_status is 1.
Pending
comment_visible is 0 and comment_junk_status is 1.
Spam
comment_junk_status is -1.
entryStatus string This is an optional parameter. Filter by parent entry's status.
Draft
entry_status is 1.
Publish
entry_status is 2.
Review
entry_status is 3.
Future
entry_status is 4.
Spam
entry_status is 5.

Request Body

Do not supply a request body.

Response

Parameter Type Description
totalResults unsigned integer The total number of comments found.
items ARRAY An array of Comments resource. The list will sorted from oldest to newest by comment_id and comment_parent_id.

Status Code

Code Description
200 no error
403 Do not have permission to retrieve the list of comments.
404 Site not found

Clone this wiki locally