\BlueLaTeX

Real-Time Collaborative Document Edition

View project onGitHub

Notifications API

Api Summary

Method Path Description
GET /<api>/users/<name>/notifications Retrieve the notifications settings
PATCH /<api>/users/<name>/notifications Modify the notifications settings
GET /<api>/notifications Retrieve the notifications of the authenticated user
DELETE /<api>/notifications Deletes the notifications of the authenticated user

Get User Notifications Settings

Method: GET

Path: /<api>/users/<name>/notifications

Response:

Code Value Meaning Headers
200 settings object The user notifications settings ETag contains the revision of the user settings (to be used when modifying them)
403 error object Logged in users may not request password reset N/A
500 error object Something wrong happened on the server side N/A

The user notifications settings is as follows:

{
  "email_notifications": false,
  "api_notifications": true
}

Modify User Notifications Settings

Method: PATCH

Path: /<api>/users/<name>/notifications

Headers: If-Match contains the revision of the user notifications settings to modify (as returned in the ETag header)

Body: A Json Patch document as per RFC-6902 that modifies the user data. A prerequisite is that the structure of the object must not be modified, only the values of standard fields (no new fields, no mandatory field removed, …)

Response:

Code Value Meaning Headers
200 true The user data was successfully modified ETag contains the new revision of the user notifications settings after modifications were applied
304 error object Not enough data were sent to perform modification N/A
401 error object User must be authenticated N/A
403 error object Not authorized to modify the user notifications settings N/A
404 error object User does not exist N/A
409 error object No revision or an obsolete revision was provided in the request N/A
500 error object Something wrong happened on the server side and the action could not be performed N/A

Get User Notifications

Method: GET

Path: /<api>/notifications

Response:

Code Value Meaning
200 notifications The current user notifications
401 error object Unauthenticated users have no notifications
500 error object Something wrong happened on the server side

The user notifications are as follows:

[
  {
    "id": "98214fe98da98c898",
    "timestamp": 1427000000,
    "username": "glambert",
    "message": "I added you as author to the paper 'Introduction to \\BlueLaTeX'"
  },
  {
    "id": "1001ea100a100cd901",
    "timestamp": 1420000000,
    "username": "lsatabin",
    "message": "I added you as reviewer to the paper 'What is a Paper?'"
  }
]

Delete User Notifications

Method: DELETE

Path: /<api>/notifications

Body: A Json list of notification identifier strings to delete.

Response:

Code Value Meaning
200 true The notifications were correctly deleted
401 error object Unauthenticated users have no notifications
500 error object Something wrong happened on the server side