Notification GET Resources

Number of unread notifications

GET /notifications/count
Parameter Type Default Description
user_id int - If specified returns the unread notifications count for that user. This requires the on_behalf_user user role.

Returns the number of unread notifications for either the current or the specified user.

{
    "notifications": 12
}

Number of unseen notifications

GET /notifications/count/unseen
Parameter Type Default Description
user_id int - If specified returns the number of unseen notifications for that user. This requires the on_behalf_user user role.

Returns the number of unseen notifications for either the current or the specified user.

{
    "notifications": 5
}

List of notifications

GET /notifications?ignore_read=true
Parameter Type Default Description
ignore_read Boolean false Returns only unread notifications if set to true otherwise all notifications will be returned
limit int 25 Sets how many hits are returned at once.
offset int 0 Offset from the first hit.
user_id int - If specified returns the notifications for that user. This requires the on_behalf_user user role.

Returns a list of notifications for either the current or the specified user.

{
    "total": 1,
    "_links": {
        "self": {
            "href": "/api/v1/notifications?ignore_read=true&offset=0&limit=10"
        }
    },
    "items": [
        {
            "question_id": 10931,
            "content": "You'll never know...",
            "url": "/question/10931/is-there-a-study-in-scarlet",
            "icon": "https://cdn.example.com/avatar/default/2d/1b84215e2f035a22f6fec213d3b1d9.jpg",
            "target_id": 912,
            "target_type": "solution",
            "id": 21,
            "is_read": true,
            "is_seen": true,
            "type": "new_solution",
            "user": {
                "id": 42,
                "is_deleted": false,
                "is_hidden": false,
                "is_system": false,
                "language": "en",
                "gender": "m",
                "firstname": "Sherlock",
                "lastname": "Holmes",
                "email": "sherlock.holmes@example.com",
                "auth_type": "simple",
                "location": "Baker Street 221B, London",
                "about": "Private Detective",
                "country": "uk",
                "company": "Ward, Lock & Co", 
                "department": "Investigations",
                "position": "Master Detective",
                "image": "https://cdn.example.com/user/6/i_2d1b84215e2f035a22f6fec213d3b1d9.jpg",
                "first_seen": "2015-02-02T11:31:05.000Z",
                "customfields": { "occupation": "Detective" },
                "score_level": 4,
                "score_points": 84
            },
            "created": "2014-10-07T08:45:20.000Z"
        }
    ]
}