[solved]Sending (push) notifications via OCS

Dear Guys,

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).

Can someone help me doing this?

Regards,
Stephan

okay i figured it out myself.
it can be done with “admin notification” app and OCS API.

curl -H "OCS-APIREQUEST: true" -u <admin>:<admin-PW> -X POST <https://<my-cloud-address.de>/ocs/v2.php/apps/admin_notifications/api/v1/notifications/<user-to-send-message-to> -d "shortMessage=<message>"

Hi @balli1187
Do you know the OCS requet to sent a push notification for the Android/IOS app?

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.