MUD
September 18, 2023, 5:57pm
1
Looking to push webhooks over to Nextcloud talk the below code works for curl:
curl -u 'USERNAME:PASSWORD' 'https://www.nextcloud.url/ocs/v2.php/apps/spreed/api/v1/chat/{TOKEN}' -H 'accept: application/json, text/plain, */*' -H 'cache-control: no-cache' -H 'content-type: application/json' -H "OCS-APIRequest: true" --data-raw '{"message":"THIS IS MY MESSAGE"}'
REPLACE : USERNAME, PASSWORD, {TOKEN} with your NextCloud info
I tied a payload of:
{
“OCS-APIRequest”: “true”,
“accept”: “application/json, text/plain, / ”,
“cache-control”: “no-cache”,
“token”: “MYTOKEN”,
“content-type”: “application/json”,
“message”: “TEST IF THIS THING WORKS”
}
Any help would be greatly appreciated! =)
Infos:
Used Zammad version: version 6.1.0-1694783928.bfa2ec1e.bookworm
Used Zammad installation type: package bookworm 12 debian
Operating system: Debian 13
Browser + version: Chrome/Firefox (current stable)
Do you want to add this inside the webhook configuration inside Zammad, to trigger this after some ticket actions?
Currently, a POST-Request with Basic-Auth should work.
OCS-APIRequest
is this maybe some special header which is required for Nextcloud?
MUD
September 19, 2023, 12:48pm
3
Thank you for the reply @dominikklein
Yes the goal is to use triggers for tickets to notify people in a group within the talk application on nextcloud, after at looking at this closer the OCS-APIRequest
is requested for the header, and I don’t think putting it in the payload is correct. But where would I add this? I used RocketChat previously with the Slack integration plugins.
Currently, the webhooks do not support adding some custom headers which seems to be needed for this situation (when OCS-APIRequest
is required).
This sounds then like a needed enhancement for the webhooks.
MUD
September 19, 2023, 1:06pm
5
Thanks, I’ll added this to a feature requests to have a field per webhooks for the custom headers in the same aura where custom payload is.
Thanks for your time!