Skip to content

DataAPI SDK english MT.DataAPI Endpoint method getComment

Taku AMANO edited this page Aug 28, 2013 · 2 revisions

getComment

Retrieve a comment.

GET https://your-host/your-mt-api.cgi/v1/sites/:site_id/comments/:comment_id Detail

Parameters

Name Type Required Description
siteId Number | Object | Function yes Site ID
commentId Number | Object | Function yes Comment ID
params Object no Options
callback Function no

Returns

XMLHttpRequest: A XMLHttpRequest object

Example

api.getComment(siteId, commentId, function(response) {
  if (response.error) {
    // Handle error
    return;
  }

  // Do stuff
});

Or

api.getComment(siteId, commentId, {fields: "date,body,parent"}, function(response) {
  if (response.error) {
    // Handle error
    return;
  }

  // Do stuff
});
Clone this wiki locally