Veo que los webhooks ahora admiten notificaciones, lo cual es fantástico. Es algo que realmente necesitamos. Sin embargo, el payload carece de una pieza crítica de información: el usuario para el que está destinada la notificación. En este ejemplo de payload podemos ver al autor del post que activó la notificación, pero no al usuario que debería recibirla.
{
"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"
}
}
}
He revisado si existe una API para obtener el usuario destinatario a partir del ID de la notificación, pero no he encontrado nada documentado. ¿Existe alguna forma de obtener el nombre de usuario o ID del destinatario en el payload de la notificación?
Para dar contexto, estamos intentando consolidar las notificaciones de varios sistemas en una experiencia única para nuestros usuarios.
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?
Hola @blake, ¿sería posible añadir también el user_external_id? Trabajamos con el SSO de Discourse y no tenemos realmente los user_ids de Discourse en nuestro sistema.
¡Vaya, qué rápido! Muchas gracias, se agradece mucho ¿Sabes cuál es el tiempo estimado aproximado para que esos cambios lleguen a los servidores de Discourse alojados?