unitedworldwrestling / arena-public

14 stars 5 forks source link

Issue with Webhook Functionality and Lack of Documentation #138

Closed aw09 closed 10 months ago

aw09 commented 11 months ago

Hi UWW IT Team,

I've been having trouble with the webhook feature in Arena, it doesn't seem to work as expected. Additionally, I've been unable to find documentation to guide me through its use.

csabavirag commented 11 months ago

Hi, what kind of issues you had with Webhooks? Perhaps the easiest way to validate your Webhook setup if you configure a webhook sending data to https://webhook.site/ where you can see all the messages (along with their message headers)

In terms of instructions, the webhook feature is intended to

For example, if you configure a webhook to send out a message when a SportEvent is updated and then you modify your SportEvent's details (change name, city, start/end date etc), you will get such a JSON message sent to your Webhook endpoint:

{
  "action": "update",
  "entity": "SportEvent",
  "id": "1eddab15-e2dd-6ec4-94bd-df4e46634c8b"
}

Then your application listening on these messages can decide to interact with your Arena and fetch this SportEvent (eg via GET /api/json/sport-event/get/1eddab15-e2dd-6ec4-94bd-df4e46634c8b) and update its local environment with the changes.

Same when you want to get a trigger in your 3rd party app on a fight change (get notification when a fight is finished). You just need to enable the webhook for the Fight entity update and build up the logic in your app to handle this notification.

aw09 commented 10 months ago

Thanks, I have tried it. Sometimes the webhook is not working and only needs restart VM or docker