Comment
Daftar Comment
http://[base_url]/comments/index
Parameter
- access_token
- key (library id)
- type ('library')
- page (optional)
- per_page (optional)
Request Url
http://[base_url]/comments/index?access_token=ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4&key=19&type=Library&per_page=1
Response
{
"meta": {
"code": 200,
"confirm": "success"
},
"data": {
"num_pages": 14,
"current_page": "1",
"current_page_result": "10",
"limit": "1",
"offset": 0,
"data": [
{
"Comment": {
"comment": "joijoireja",
"status": 3,
"elapsed_time": "255 days, 13 hours ago",
"user_id": 1574,
"key": 19,
"parent_id": null,
"created": "2014-07-13 02:00:48",
"type": "Library",
"id": 76,
"modified": "2014-07-13 02:00:58"
},
"User": {
"username": "mm_aji@yahoo.com",
"status_follow": "true",
"name": "Aji Guns",
"url_profile": "http://[static_url]/users/views/1574",
"avatar": "http://[static_url]/img/user/avatar/6e7febec0c848a15b2242a461f39447a_1574.png",
"id": 1574
},
"Like": {
"has_like": 0,
"has_report": 0,
"total_likes": 1,
"total_reports": 0
}
}
],
"total_result": 14
}
}
Add Comment
Method
POST
endpoint ini berfungsi untuk membuat komentar
Endpoint
http://[base_url]/comments/add
Parameter
- access_token
- type : data yang di-like
- key : id dari data
- comment : isi komentar
Contoh request
http://[base_url]/comments/add
post parameter
{"access_token":"ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4","type":"Feed","key":"9597","comment":"test 123"}
menghasilkan
{
"meta": {
"code": 200,
"confirm": "success"
},
"data": {
"comment": {
"comment": "test 123",
"status": 1,
"user_id": 1777,
"key": 9597,
"parent_id": null,
"created": "2015-02-25 15:40:36",
"type": "Feed",
"id": 126,
"modified": "2015-02-25 15:40:36"
}
}
}
Delete comment
Method
DELETE
endpoint ini berfungsi untuk menghapus komentar
Endpoint
http://[base_url]/comments/delete/<comment_id>
Parameter
[get]
- access_token
Contoh request
http://[base_url]/comments/delete/123?access_token=ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4
menghasilkan
{
"meta": {
"code": 200,
"confirm": "success"
},
"data": {
"message": "Comment has been deleted succesfully"
}
}