Notifikasi

Method
GET
Endpoint
/apis/notifications
Parameter
- access_token
- per_page (optional)
- page (optional)
Contoh
http://[static_url]/notifications?access_token=ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4
http://[static_url]/notifications?access_token=ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4&per_page=1&page=2
Response
{
"meta": {
"code": 200,
"confirm": "success"
},
"data": {
"num_pages": 42,
"current_page": "1",
"current_page_result": 10,
"limit": "1",
"offset": 0,
"data": [
{
"Notification": {
"is_read_lightnotif": "0",
"sender_key": "1646",
"object_type": "Comment",
"modified": "2015-03-09 13:12:21",
"is_read": "0",
"recipient_type": "User",
"message": "just commented on a review",
"id": "1835",
"created": "2015-03-09 13:12:21",
"sender_type": "User",
"elapsed_time": "8 days, 21 hours ago",
"action_type": "COMMENT_REVIEW",
"object_key": "166",
"recipient_key": "1755"
},
"Object": {
"Comment": {
"comment": "coba",
"status": "1",
"elapsed_time": "8 days, 21 hours ago",
"user_id": "1646",
"parent_id": null,
"created": "2015-03-09 13:12:21",
"type": "Review",
"id": "166",
"modified": "2015-03-09 13:12:21"
},
"Book": {
"description": "<p>No Description</p>\r\n<p></p>",
"cover": "http://[static_url]/publication/book/cover/b0c762d113288c16dc1d32d7f5ec76_175x250.png",
"id": "1011",
"title": "Media Kooperasi dan Kooperasi Media"
}
},
"Sender": {
"User": {
"url_profile": "http://[static_url]/users/view/1646",
"id": "1646",
"avatar": "http://[static_url]/img/default_avatar.png",
"name": "eckoanto"
}
},
"OtherRecipients": []
}
],
"total_result": 42
}
}
Mark Read Notifications
URL (method:POST)
http://[base_url]/notifications/mark_read
Parameters
Field |
Description |
Format |
Mandatory |
access_token |
|
varchar(255) |
true |
notification_ids |
|
Integer |
true |
http://[base_url]/notifications/mark_read
Data
{"access_token":"ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4","notification_ids":"[100,101]"}
Output
{"meta":{"code":200,"confirm":"mark read success"}}
Total New
URL (method:GET)
http://[base_url]notifications/total_new
Parameters
Field |
Description |
Format |
Mandatory |
access_token |
|
varchar(255) |
true |
http://[base_url]/notifications/total_new?access_token=ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4
Output
{"meta":{"code":200,"confirm":"success"},"data":2}
Reset Count
URL (method:POST)
http://[base_url]2/notifications/reset_count
Parameters
Field |
Description |
Format |
Mandatory |
access_token |
|
varchar(255) |
true |
{
"access_token": "ggae3ulbri9njvibisvc7sc6o7ge52yp40pjrkg4"
}
Output
{
"meta": {
"code": 200,
"confirm": "success"
},
"data": "success"
}