Skip to content

Commit 8246468

Browse files
committed
Added documentation for new notification API
1 parent 49488d8 commit 8246468

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

doc/notification.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Notification API
2+
[Back to the navigation](index.md)
3+
4+
Listing notifications and marking them as read.
5+
Wraps [GitHub Notification API](https://developer.github.com/v3/activity/notifications/).
6+
7+
### List notifications
8+
9+
```php
10+
$issues = $client->api('notification')->all();
11+
```
12+
13+
Returns an array of unread notifications.
14+
15+
### Include already read notifications, including participating, or since a certain date
16+
17+
```php
18+
$includingRead = true;
19+
$participating = true;
20+
$since = new DateTime('1970/01/01');
21+
$issues = $client->api('notification')->all($includingRead, $participating, $since);
22+
```
23+
24+
Returns an array of all notifications
25+
26+
### Mark notifications as read
27+
28+
```php
29+
$client->api('notification')->markRead();
30+
```
31+
32+
or up until a certain date
33+
34+
```php
35+
$client->api('notification')->markRead(new DateTime('2015/01/01'));
36+
```
37+
38+
Marks all notifications as read up until the current date, unless a date is given

0 commit comments

Comments
 (0)