Events

Each event has a similar JSON schema, but a unique data object that is determined by its event type.

Notifications

Triggered when a new notification is triggered

Data payload

Field Type Description
id integer Notification id
type string Notification type
question_id integer Question id the notification relates to (or null).
target_id integer Id of the entity the notification relates to.
target_type string Type of the entity the notification relates to.
target_object JSON The JSON Object representation of the entity the notification relates to.
content string DEPRECATED: The content information should be retrieved directly from the target_object. Notification text
url URL Absolute url to the Starmind application.
icon URL Absolute url to a image for that notification.
is_read boolean Whether the user (receiver) has already read that notification.
created datetime The datetime the notification was created.

Event name

notifications

Payload example

{
    "sender": {
        "id":21,
        "unique_id":"siger-holmes",
        "email":"siger.holmes@starmind.com",
        "firstname": "Siger",    
        "lastname": "Holmes",
        "image":"http://appdata.starmind.local:8080/1/user/3"
    },
    "receiver": {
        "id": 42,
        "unique_id":"sherlock-holmes",
        "email": "sherlock.holmes@example.com",
        "firstname": "Sherlock",
        "lastname": "Holmes",
        "image": "https://cdn.example.com/user/6/i_2d1b84215e2f035a22f6fec213d3b1d9.jpg"
    },
    "data": {
        "id":1,
        "question_id":1,
        "url":"/question/1",
        "icon":"http://cdn.example.com/1/avatar/c3/6569d56ff7f370e4062cab0b4d1fc9.jpg",
        "is_read":false,
        "content":"Elementary, my dear Watson.",
        "target_type":"comment",
        "target_id":1,
        "target_object": {
            "question": "/questions/1",
            "description": "I don't think there is a study.",
            "is_deleted": false,
            "promoted_solution": null,
            "content_updated": "2017-06-09T09:33:52.000Z",
            "id": 123,
            "updated": "2017-06-09T09:33:52.000Z",
            "user": null,
            "created": "2017-06-06T09:33:52.000Z"
        },
        "type":"new_comment_to_solution",
        "created":"2015-11-03T08:33:19.000+01:00"
    }
}