Blog post

Introducing webhooks 🎣

by Alex on 7/24/2019, 2:00:00 PM

Today I am excited to release the first version of JustComments Webhooks!

What is a webhook?

Webhook is a feature which allows you to define a URL on your server which is invoked by JustComments when something happens. Currently, JustComments invokes the URL when a new comment is created. It helps you in the following use cases:

  • triggerring a rebuild of your static website to update the comment count or the content
  • notifying the moderators about the comment using a 3rd-party tool, e.g. a CRM system

So how does it work in details?

In your account settings, you can enter a URL that JustComments invokes whenever someone posts a comment. JustComments sends a POST request with a timeout of 2 seconds. The request's content type is application/json and the body is a JSON object with the following required attributes pageId, commentId and an optional commentUrl. Additionally, the request contains an Authorization token signed with your account's secret.

Example request:

POST /your-path HTTP/1.1
User-Agent: JustComments Webhook
Host: your-host
Content-Type: application/json
Authorization: Bearer jwt

{"commentId": "id here", "pageId": "pageId", "commentUrl": "commentUrl"}

Note that webhooks consume additional credits. Every invocation consumes 1 credit.

You can find the documentation section for this feature here:

I am looking forward to seeing the integrations you build using webhooks and the API. Share your thoughts and challenges you encounter with webhooks!

follow: blog | twitter | github | indiehackers

Are you ready to get started?
  • Learn about our pricing.
  • Every new account gets 100 000 free credits for a trial period. No credit card required.
  • Creation of comments and storage of comments is for free.