I see that webhooks now support notifications which is fantastic. Something we really need. However the payload is missing one critical piece of information - the user the notification is for. In this example payload we can see the author of the post that triggered the notification, but not the user that should receive the notification.
{
"notification": {
"id": 119,
"notification_type": 9,
"read": false,
"created_at": "2019-09-18T13:42:21.248Z",
"post_number": 1,
"topic_id": 75,
"fancy_title": "Phallguy should get a notice about this",
"slug": "phallguy-should-get-a-notice-about-this",
"data": {
"topic_title": "Phallguy should get a notice about this",
"original_post_id": 111,
"original_post_type": 1,
"original_username": "Paul_Alexander",
"revision_number": null,
"display_username": "Paul_Alexander"
}
}
}
I’ve looked to see if there’s an API to get the target user from notification id but haven’t found anything documented. Is there a way we can get the target username/id in the notification payload?
For context, we are trying to consolidate notifications from multiple systems into a single experience for our users.
Just looked at this briefly to see if there was a quick answer, and you are right, it does not look like we have a get api endpoint for fetching an individual notification by id, but that wouldn’t be very efficient to call every time anyways.
Most likely this will require a code change to the notification serializer to include the user_id/username inside of the notification payload, so that a separate api request wouldn’t be necessary.
We’re using the hosted service at the moment otherwise I’d build my own plugin. Would you folks consider adding the user id/username to then notification payload in the webhook?
Hi @blake, would it be possible to also add the user external_id? We work with Discourse’s SSO and we don’t really have the discourse user ids in our system.