diff --git a/doc/notification.md b/doc/notification.md index d586b364c74..b47c1d5f7c3 100644 --- a/doc/notification.md +++ b/doc/notification.md @@ -36,3 +36,10 @@ $client->api('notification')->markRead(new DateTime('2015/01/01')); ``` Marks all notifications as read up until the current date, unless a date is given + +## Get a single notification using his ID + +```php +$client->api('notification')->id($id); +``` +Retrieves single notification data using his ID. diff --git a/lib/Github/Api/Notification.php b/lib/Github/Api/Notification.php index d7a1be66555..e8d5d8f7810 100644 --- a/lib/Github/Api/Notification.php +++ b/lib/Github/Api/Notification.php @@ -57,4 +57,15 @@ public function markRead(DateTime $since = null) $this->put('/notifications', $parameters); } + /** + * Gets a single notification using his ID + * + * @link https://developer.github.com/v3/activity/notifications/#view-a-single-thread + * + * @param int $id + */ + public function id($id) + { + return $this->get('/notifications/threads/'.$id); + } }