Hi everybody! Wishing you a Happy New Year ![]()
In another http://forum.mikrotik.com/t/post-request-with-fetch/108061/82 I was looking for the solution to replace pushbullet which sends the system notifications from Mikrotik router and other devices with Nextcloud Talk. Let me add, Nextcloud Talk allows anonymous users to post their messages as well. Through several consultations, I found that it is easy to send notifications for authorised (real) users, but not so easy for the anonymous ones:
Script which works fine for authorised users:
/tool fetch http-method=post http-header-field="Content-Type:application/json,OCS-APIRequest:true,Accept:application/json,Authorization: 'Basic <base64 encrypted password>'" http-data="{\"token\":\"<roomid<\",\"message\":\"hi there @all\"}" url="https://domain.tld/ocs/v2.php/apps/spreed/api/v1/chat/<roomid>"
For anonymous users, I was advised here https://github.com/nextcloud/spreed/issues/6736 to catch cookies https://stackoverflow.com/questions/30760213/save-cookies-between-two-curl-requests#37127263 and place them either to memory or in a separate file and re-use them again.
Sadly, the conversation on a Nextcloud forum hasn’t brought much more help https://help.nextcloud.com/t/nextcloud-talk-api-send-message-by-a-guest/129956. The authors of the previous thread, which I have mentioned earlier, has suggested starting a new one. Perhaps, you have had already faced the same or similar challenge? I will be appreciative of your feedback.