GET /comment

Get comments of an item

Example URI

http://example.com/restful_api/comment?type_id=app&item_id=9&app_id=PHPfox_Videos

Parameters

ParameterTypeRequire ?Description
type_idstringyesType id of the item
item_idnumberyesItem id
app_idstringnoRequire if item type is app
parent_modulestringnoRequire for get comments on app item on pages/groups
limitnumbernoLimit return results
pagenumbernoPaging return results

Response

{
  "status": "success",
  "data": [
    {
      "is_liked": null,
      "comment_id": "14",
      "parent_id": "0",
      "type_id": "app",
      "item_id": "9",
      "user_id": "1",
      "owner_user_id": "10",
      "child_total": "1",
      "total_like": "0",
      "text": "Great video"
    }
  ],
  "messages": []
}

POST /comment

Add comment on an item

Example URI

http://example.com/restful_api/comment

Parameters

ParameterTypeRequire ?Description
val[type]stringyesType id of the item
val[item_id]numberyesId of the item
val[text]stringyesComment text
val[parent_id]numbernoRequire for adding reply on comment
val[app_object]stringnoRequire if comment on an app item
val[parent_module]stringnoParent type of the app item

Response

 {
  "status": "success",
  "data": {
    "is_liked": null,
    "comment_id": "15",
    "parent_id": "14",
    "type_id": "app",
    "item_id": "9",
    "user_id": "1",
    "owner_user_id": "10",
    "child_total": "0",
    "total_like": "0",
    "text": "Yes. A great song for Christmas day.",
    "unix_time_stamp": "1481252047"
  },
  "messages": [
    "Comment successfully added."
  ]
}

GET /comment/:id

Get information of a specific comment

Example URI

http://example.com/restful_api/comment/14

Parameters

ParameterTypeRequire ?Description
idnumberyesComment id

Response

{
  "status": "success",
  "data": {
    "is_liked": "24",
    "comment_id": "14",
    "parent_id": "0",
    "type_id": "app",
    "item_id": "9",
    "user_id": "1",
    "owner_user_id": "10",
    "child_total": "1",
    "total_like": "1",
    "text": "great video",
    "unix_time_stamp": "1481251788"
  },
  "messages": []
}

PUT /comment/:id

Update comment content

Example URI

http://example.com/restful_api/comment/14

Parameters

ParameterTypeRequire ?Description
idnumberyesComment id
textstringyesText to update

Response

 {
  "status": "success",
  "data": {
    "is_liked": "24",
    "comment_id": "14",
    "parent_id": "0",
    "type_id": "app",
    "item_id": "9",
    "user_id": "1",
    "owner_user_id": "10",
    "child_total": "1",
    "total_like": "1",
    "text": "Great Music Video!",
    "unix_time_stamp": "1481251788"
  },
  "messages": [
    "Comment successfully updated."
  ]
}

DELETE /comment/:id

Delete a specific comment.

Example URI

http://example.com/restful_api/comment/14

Parameters

ParameterTypeRequire ?Description
idnumberyesComment id

Response

 {
  "status": "success",
  "data": [],
  "messages": [
    "Comment successfully deleted."
  ]
}