This document provides a simple step-by-step guide on how to set up a webhook to receive notifications in JSON format with specific fields.
1. Introduction #
Webhooks provide a way for Notifier.so to send real-time notifications to your application when a match occurs. In this case, we’ll be setting up a webhook to receive JSON data with the following fields:
- type
- title
- text
- subreddit
- url
2. Setting Up the Webhook #
Follow these steps to set up a webhook with Notifier.so:
- Log in to your Notifier.so account.
- Add a Searcher and select webhooks for the Notification type
- Provide the URL where you want to receive the JSON payload. This should be an endpoint on your application that is configured to process incoming JSON data.
- Add The Searcher
3. JSON Payload Format #
When an event occurs, Notifier.so will send a JSON payload to the specified URL. The payload will contain the following fields:
- type: The type of match. Reddit, Facebook, etc
- title: The title of the post or comment.
- text: The text content of the post or comment.
- subreddit: The name of the subreddit where the event occurred.
- url: The URL to view the post or comment on Reddit.
4. Example Payload #
Here’s an example JSON payload for a new post event:
{
"type": "reddit",
"title": "Introducing our new product!",
"text": "We're excited to announce the launch of our new product. Check it out at our website!",
"subreddit": "r/ProductNews",
"url": "https://www.reddit.com/r/ProductNews/comments/xyz123/introducing_our_new_product"
}
5. Conclusion #
Once you have set up the webhook, your application will start receiving JSON payloads with the specified fields whenever a new match occurs. Make sure your application is ready to handle these incoming payloads and process the data as required.