Allow non-admins to use notifications as a push web service
I'd like to see the possibility of sending notifications from external sources to individuals in Nextcloud (I imagine something like Pushbullet or Pushover) where I can replace said services with Nextcloud.
I imagine on should be able to generate tokens (one for each service one wishes to receive push messages from?). An token along with an URL would be used in an webhook where the external source pushes messages to NC.
In the longrun I hope to see notifications in the Android app, where these push messages also would appear 😄
Push notifications are coming to android soon. As for an API see https://github.com/nextcloud/admin_notifications
Might do what you are looking for.
@nickvergessen Well just partly I guess.
From https://github.com/nextcloud/admin_notifications: HTTP request
curl -H "OCS-APIREQUEST: true" -X POST \
https://admin:admin@localhost/ocs/v2.php/apps/admin_notifications/api/v1/notifications/admin \
-d "shortMessage=Short message up to 255 characters" \
-d "longMessage=Optional: longer message with more details, up to 4000 characters"
This would mean I need to expose the admin user/password to the external source, right? A big no-no if I guessed that right. Otherwise this is exactly what I want to do.
Besides you rarely have the option to specify headers
This would mean I need to expose the admin user/password to the external source, right? A big no-no if I guessed that right. Otherwise this is exactly what I want to do.
Use an app password should also work. But maybe we add a feature to specify a user that has the same rights to send notifications.
Well if this doesn't meet your requirements, we can discuss the functionality in the admin_notifications repo. Maybe an option for adding support of other "groups" would work. Then you can create an empty user which is part of such a group?
Copying the question and answer from https://github.com/nextcloud/admin_notifications/issues/13
Q: You mean instead of an admin tool any user should be able to use this endpoint to spam themselves?
A:
yes pretty much, just think of Pusbullet or Pushover but self hosted utilizing existing and possibly new infrastructure/code (server, mobile apps etc.)
Imagine doing something like the "app passwords" functionally which already exist in NC but instead the user generates an token which could be used to send notifications to himself. For instance I would generate an token to use with service Xy, at Service Xy I register an webhook to post an notification to an Nextcloud endpoint (see OP) which would then notify me on all platforms I use Nextcloud with (web, android, desktop).
I really need this. How is the current status?