Help > Forum > Website Integration > Using Webhooks

Using Webhooks

Use webhooks to be notified about events that happen in your forum.

When the event occurs - for example, when a new user creates an account on your forum - Website Toolbox creates an Event object. This object contains all the relevant information about what just happened, including the type of event and the data associated with that event. We then send the Event object as JSON to your webhook URL via an HTTP POST request.

Webhooks work great when combined with the forum API. For example, the webhook can notify your application when a new user registers on your forum and then you can use the API to make modifactions to that user's forum account.

The following events are currently supported: user.created, user.approved, user.updated, user.deleted, user.email.verified, user.payment.received, user.paid_subscription.started, user.paid_subscription.ended, topic.created, topic.updated, topic.deleted, post.created, post.approved, post.updated, post.deleted, conversation.created, and message.created. Please let us know if you need a certain new webhook event.


Configuring your webhook settings

  1. Log in to your Website Toolbox account.
  2. Click the Settings link.
  3. In the Settings menu, click the Notification link.
  4. Enter your webhook URL in the text box next to the Webhook option.

Responding to a webhook

To acknowledge receipt of a webhook, your endpoint should return a 2xx HTTP status code. Any other information returned in the request headers or request body is ignored. All response codes outside this range, including 3xx codes, will indicate that you did not receive the webhook. This does mean that a URL redirection or a "Not Modified" response will be treated as a failure.

If a webhook is not successfully received for any reason, we will continue trying to send the webhook once an hour for up to 3 days.


An example event

{
  "api_version": "1",
  "data": {
    "object": {
      "signature": "Thanks, John.",
      "name": "John Doe",
      "allowEmails": false,
      "lastPostTimestamp": 0,
      "userGroups": [7440, 2452, 52423],
      "userTitle": "Power User",
      "reputation": 423,
      "username": "john",
      "postCount": 32,
      "userId": 181855,
      "lastVisitTimestamp": 1322811119,
      "instantMessagingType": "",
      "instantMessagingId": "",
      "object": "User",
      "invisible": false,
      "email": "johnDoe@gmail.com",
      "avatarUrl": "https://test.com/images/avatar.png",
      "joinDateTimestamp": 1322811119,
      "enableMessages": true
    }
  },
  "object": "event",
  "id": 1534,
  "type": "user.created",
  "mode": "live"
}


Viewing webhook events and responses

You can view the events that were sent to your webhook and the response that was received from your webhook by following the instructions below:

  1. Log in to your Website Toolbox account.
  2. Click the General link.
  3. In the General menu, click the Webhook link. (If there is no Webhook link, that means a webhook URL hasn't been provided in the webhook settings yet.)


If you still need help, please contact us.