DataAPI SDK english MT.DataAPI Endpoint method listComments - movabletype/mt-data-api-sdk-js GitHub Wiki
Retrieve a list of comments.
GET https://your-host/your-mt-api.cgi/v1/sites/:site_id/comments Detail
| Name | Type | Required | Description |
|---|---|---|---|
| siteId | Number | Object | Function | yes | Site ID |
| params | Object | no | Options |
| callback | Function | no |
XMLHttpRequest: A XMLHttpRequest object
api.listComments(siteId, function(response) {
if (response.error) {
// Handle error
return;
}
// Do stuff
});Or
var params = {
fields: "date,body,parent"
};
api.listComments(siteId, params, function(response) {
if (response.error) {
// Handle error
return;
}
// Do stuff
});