notifications.go
changeset 148 ae2cbcf18b55
parent 138 23d3a518d0ad
child 149 5f922977d7c7
--- a/notifications.go	Fri Apr 28 11:47:18 2017 +0200
+++ b/notifications.go	Fri Apr 28 13:28:16 2017 +0200
@@ -40,6 +40,17 @@
 	return &notification, nil
 }
 
+// DismissNotification deletes a notification
+func (mc *Client) DismissNotification(notificationID int) error {
+	if notificationID < 1 {
+		return ErrInvalidID
+	}
+
+	endPoint := "notifications/dismiss"
+	params := apiCallParams{"id": strconv.Itoa(notificationID)}
+	return mc.apiCall(endPoint, rest.Post, params, &Notification{})
+}
+
 // ClearNotifications deletes all notifications from the Mastodon server for
 // the authenticated user
 func (mc *Client) ClearNotifications() error {