You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/api/native-api.rst
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5932,6 +5932,8 @@ Notifications
5932
5932
5933
5933
See :ref:`account-notifications` in the User Guide for an overview. For a list of all the notification types mentioned below (e.g. ASSIGNROLE), see :ref:`mute-notifications` in the Admin Guide.
5934
5934
5935
+
.. _get-all-notifications:
5936
+
5935
5937
Get All Notifications by User
5936
5938
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5937
5939
@@ -5941,6 +5943,52 @@ Each user can get a dump of their notifications by passing in their API token:
The expected OK (200) response looks something like this:
5947
+
5948
+
.. code-block:: text
5949
+
5950
+
{
5951
+
"status": "OK",
5952
+
"data": {
5953
+
"notifications": [
5954
+
{
5955
+
"id": 38,
5956
+
"type": "CREATEACC",
5957
+
"displayAsRead": true,
5958
+
"subjectText": "Root: Your account has been created",
5959
+
"messageText": "Hello, \nWelcome to...",
5960
+
"sentTimestamp": "2025-07-21T19:15:37Z"
5961
+
}
5962
+
...
5963
+
5964
+
Get Unread Count
5965
+
~~~~~~~~~~~~~~~~
5966
+
5967
+
You can get a count of your unread notifications as shown below.
5968
+
5969
+
.. code-block:: bash
5970
+
5971
+
curl -H "X-Dataverse-key:$API_TOKEN" -X GET "$SERVER_URL/api/notifications/unreadCount"
5972
+
5973
+
Mark Notification As Read
5974
+
~~~~~~~~~~~~~~~~~~~~~~~~~
5975
+
5976
+
After finding the ID of a notification using :ref:`get-all-notifications`, you can pass it to the "markAsRead" API endpoint as shown below. Note that this endpoint is idempotent; you can mark an already-read notification as read over and over.
0 commit comments