DEV Community

Cover image for Webhooks
Inioluwa Adeyemo
Inioluwa Adeyemo

Posted on

1

Webhooks

WEBHOOKS

Webhooks are ways for a web application and external service to send real-time notification to one or more applications. They are automated HTTP requests, triggered when specific events such as comments being posted to a blog, occurs in a source system and sent to a destination system, sometimes with a payload of data.

Cartoon Webhooks

The concept of webhooks consists of two parties:

  • The sender:- The application that is notifying another system about an event. It gathers important data about the event and packages it in a payload, then initiates an HTTP POST request containing the payload data to the webhook URL or endpoint already provided by the receiver.

  • The receiver:- The application that receives and processes the webhook data. It receives the HTTP request and extracts and processes the payload data.

Sender and Reciever

THINGS TO NOTE ABOUT WEBHOOKS

  • Webhooks payloads are usually in serialized form-encoded JSON or XML formats.

  • Both the sender and receiver applications must have the necessary functionalities to send and receive HTTP requests.

  • A secure HTTPS URL endpoint should be provided as the webhook receiver.

  • It is best to respond with a 200 or 302 HTTP response status code when a notification is sent.

  • A single webhook request can be distributed to multiple destinations that need the information.

USES OF WEBHOOKS

Webhooks are used in web development to enable communication between different services, some other uses are;

  • Data Synchronization

  • Integration with Third-Party Services

  • Real-time Updates

  • Web Analytics and Tracking

CONCLUSION

Webhooks have become a popular method to improve efficiency among online platforms by enabling real-time communication between applications.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

Collapse
 
riyebaaa profile image
Sharon is Phenomenal 💕

This is very enlightening. Thank you for sharing.

Collapse
 
_calliope_11 profile image
Adedeji Abiola Eunice

Good write up, Ini.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay