The discussion revolves around the content of webhook payloads in Discourse. hollyw inquires about the similarity between webhook payloads and the Discourse API, as well as whether the payloads include emails. simon responds that there isn’t a list of webhook payloads, but they are similar to the API documentation with some exceptions. He suggests configuring a test webhook to view the payload. The test confirmed that emails are included in the payload, as seen in the screenshot provided. hollyw follows up, stating that they have successfully set up a test webhook and obtained the desired payloads.
We’re looking to potentially use webhooks to send data on certain types of events for metrics purposes. Are the payloads for these events listed anywhere, or are the webhook payloads identical to the ones in the Discourse API?
For example, we may set up one for user events, and in that case would the payload contain all the standard user JSON returned in the /admin/users/list/{flag}.json endpoint, or would it be different? Same question for post events with the /posts.json endpoint, and topics with /latest.json.
Along those lines, I know with the aforementioned user endpoint you can specify show_emails=true when using the API, so I was wondering - does the payload from the webhook include emails?
I do not know of a list of the webhook payloads. The payloads are similar to what you see in the Discourse API documentation, but some fields are not included in the payload and in a few cases extra fields are added.
The easiest way I know of to see what gets sent in the payload is to configure a webhook on Discourse to point to http://example.com and then perform an action on the site to trigger the webhook. You can then see the payload by clicking the “Request” button from the webhook’s events list: