i read a little about the open collaboration service (OCS) API but iām not sure if i understand i right or not.
iām interested in notifications. Is there a way to send (push) notifications to a user or group via this API? I would like to use my nextcloud as a push-Server for other Services (like Home automation).
With OCC it is possible with
php occ notification:generate username "This is a message"
Actually i want to call this from another system (another docker-Container).
Hi @arkhej,
It is the curl-request in my former post.
This sends message to the specified user. In my case I get notifications on Android, ios and even Windows if client app has permissions.
in version Nextcloud 22.1.X, the following worked for me:
curl -H "OCS-APIREQUEST: true" -X POST \
https://<AdminID:AdminAppPassword>@<SERVER>/ocs/v2.php/apps/notifications/api/v2/admin_notifications/<user> \
-d shortMessage="Short Message" \
-d longMessage="This is the long message"
Hello, Can someone explain how this solution actually works? I installed the admin notification but cannot find any settings. Where will i insert the OCS API?
@gerstavros
The OCS API is shipped with Nextcloud server but it is not meant to be used on user level (web interface).
If you want to use the notifications you have to ssh into your Nextcloud host (a Linux machine, raspberry Pi, whatever) and type the curl request into the shell.
Ok but i donāt get push notification. Also this doesnāt solve the notifications of talk and calendar apps. The platform is useless without real-time notifications
Notifications from calendar and other build-in features should work out of the box. Itās working for me in the last 3 years without my OCS hacks.
So if you donāt get notifications at all, I suggest to open a new Thread or GitHub issue and discuss with admins.
To be honest, I also had some missing notifications in the last days after trying Nextcloud talk. After removing Talk app and reconnecting the Nextcloud files app on my iPhone, itās working fine.
Iām using the OCS API to utilize Nextcloud for my home automation system and send HA notifications through Nextcloud App.
To your last sentence: Nextcloud is open source. If it doesnāt meet your needs and expectations, feel free to contribute.