I had an issue on my side receiving the webhook requests and processing what I need. It was fixed but would be great If I could re-trigger all failed requests, instead of clicking one by one.
Is it possible for someway?
Hey Lucas,
Just to be sure, are you talking about the button when you say “re-trigger” a request?
Yes, exactly this button.
But my question is if exists another way to reprocess many requests at the same time.
I’m not aware of a built-in way. You can create a custom script that would do this:
-
Through the API, get the list of the webhooks events at
https://your-discourse.com/admin/api/web_hook_events/X.json
Where X is your webhook ID. -
The endpoint lists the 50 last events. Use the
offset
query parameter to go further in the list. For example:
https://your-discourse.com/admin/api/web_hook_events/1.json?offset=50
-
Loop through every returned event. For each event, do a POST request to
https://your-discourse.com/admin/api/web_hooks/2/events/XXX/redeliver
Where XXX is the event’s ID. -
Because of the API rate limit, wait at least a few seconds between each API call.
Tested and working
And thanks @Lucas_Alves for learning me about the offset
parameter
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.