As I did not find an occ subcommand to handle messages from within a shellscript I tried curl to get this done.
As this is my first time using webapi maybe I did not get all facts I need.
So I’m asking for help here.
As I read in https://nextcloud-talk.readthedocs.io/en/turn_doc/chat/ the base endpoint to talk is /ocs/v2.php/apps/spreed/api/v1 and before sending a message I need the token of the conversation I want to post a message.
user:password could be “application password” for 2FA enabled users. I created a dedicated user for talk messages, enabled 2FA for this user and created app password without files access to reduce possible attack vector.
@wwe I tried your example with Nextcloud 29 but without success: curl -H "Content-Type: application/json" -H "Accept: application/json" -H "OCS-APIRequest: true" -v -u {user:password} -d '{"token": "{xxxxxxx}", "message":"test from linux"}' https://example.com/ocs/v2.php/apps/spreed/api/v1/chat/xxxxxxx
Note: user/password/url/token masked.