Helpjuice Webhooks
Automate and integrate your Helpjuice knowledge base with external systems using real-time event notifications
Table of Contents
Why Should I Use Webhooks? Webhook Fields Webhook Events Retrieve all webhooks Retrieve a webhook Create a webhook Update a webhook Toggle a webhook Test a webhook Delete a webhook Best PracticesWebhooks in Helpjuice allow your knowledge base to communicate with other applications by sending real-time HTTP POST requests when specific events occur. This enables seamless integration and automation of workflows, such as syncing user data or triggering external processes upon content updates.
In this article, you’ll learn:
- The benefits of using webhooks in your Helpjuice account
- The structure of webhook payloads and available fields
- A list of supported webhook events and their triggers
- How to retrieve and manage webhooks via the API
Why Should I Use Webhooks?
The main advantages of webhooks include reduced latency and bandwidth usage, as they eliminate the need for frequent polling. They are especially useful for scenarios requiring immediate data synchronization, such as payment processing, real-time messaging, and automated workflows. By enabling instant interactions between web applications, webhooks enhance efficiency and responsiveness in modern web architectures.
Webhook Fields
These are the fields we sent in the Webhook:
-
event
: a string identifying the event (user_create
,user_delete
, etc.) -
activity_fields
: an object containing the following fields:- id: Activity ID
- action: a string describing the action that triggered the Webhook (publish, create, etc.)
- trackable_type: a string indicating what was affected (a User, for example)
- trackable_id: the ID of the affected model (the ID of the User that was created, for example)
- owner_type: a string indicating the type of who did this activity (usually this is the User that performed the action)
- owner_id: the ID of who was responsible for generating this activity (the ID of the User that created the article, for example)
- created_at: timestamp indicating when the activity was performed.
- extra: a JSON object that contains extra information about the activity.
- published_activity_id: ID of the activity publication. This is something that Helpjuice uses to track the activity internally.
- automatic: if the article was automatically published/expired.
-
activity
: a string containing theactivity_fields
object serialized.
Webhook Events
The available events for webhooks are:
Event Name | Description |
---|---|
user_create |
Called when a user is created. |
user_update |
Called when a user is updated. |
user_delete |
Called when a user is deleted. |
question_create |
Called when an article is created. |
question_update |
Called when an article is updated. |
question_delete |
Called when an article is deleted. |
question_archive |
Called when an article is archived. |
question_publish |
Called when an article is published. |
comment_create |
Called when a comment is created. |
comment_update |
Called when a comment is updated. |
comment_delete |
Called when a comment is deleted. |
category_create |
Called when a category is created. |
category_update |
Called when a category is updated. |
category_delete |
Called when a category is deleted. |
API Endpoints
We have API V3 endpoints available for managing webhooks all through our API. You can find more information about each endpoint below. For more information on how our API V3 works, check this article.
Retrieve all webhooks
URL
GET https://<your-account>.helpjuice.com/api/v3/webhooks
RESPONSE raw
{
"meta": {
"current": 1,
"limit": 25,
"total_pages": 1,
"total_count": 2
},
"articles": [
{
"id": 3,
"url": "<URL>",
"event": "user_delete",
"last_response_code": null,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:03.224Z",
"created_at": "2023-05-09T19:12:03.224Z",
"updated_at": "2023-05-09T19:12:03.224Z"
},
{
"id": 4,
"url": "<URL>",
"event": "category_create",
"last_response_code": null,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:31.289Z",
"created_at": "2023-05-09T19:12:31.289Z",
"updated_at": "2023-05-09T19:12:42.020Z"
}
]
}
Retrieve a webhook
URL
GET https://<your-account>.helpjuice.com/api/v3/webhooks/:id
RESPONSE raw
{
"id": 3,
"url": <URL>,
"event": "user_delete",
"last_response_code": null,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:03.224Z",
"created_at": "2023-05-09T19:12:03.224Z",
"updated_at": "2023-05-09T19:12:03.224Z"
}
Create a webhook
URL
POST https://<your-account>.helpjuice.com/api/v3/webhooks
BODY raw
{
"id": 3,
"url": <URL>,
"event": "user_delete",
"last_response_code": null,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:03.224Z",
"created_at": "2023-05-09T19:12:03.224Z",
"updated_at": "2023-05-09T19:12:03.224Z"
}
Field | Type | Description |
---|---|---|
url |
String | URL to post the activity to. |
event |
String |
Event type |
Update a webhook
URL
PUT https://<your-account>.helpjuice.com/api/v3/webhooks/:id
BODY raw
{
"id": 3,
"url": <URL>,
"event": "user_delete",
"last_response_code": null,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:03.224Z",
"created_at": "2023-05-09T19:12:03.224Z",
"updated_at": "2023-05-09T19:12:03.224Z"
}
Field | Type | Description |
---|---|---|
url |
String | URL to post the activity to. |
event |
String |
Event type |
Toggle a webhook
URL
PUT https://<your-account>.helpjuice.com/api/v3/webhooks/:id/toggle
BODY raw
{
"id": 3,
"url": <URL>,
"event": "user_delete",
"last_response_code": null,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:03.224Z",
"created_at": "2023-05-09T19:12:03.224Z",
"updated_at": "2023-05-09T19:12:03.224Z"
}
Test a webhook
URL
POST https://<your-account>.helpjuice.com/api/v3/webhooks/:id/test
BODY raw
{
"id": 3,
"url": <URL>,
"event": "user_delete",
"last_response_code": 200,
"account_id": 6,
"created_by_id": 6,
"enabled_at": "2023-05-09T19:12:03.224Z",
"created_at": "2023-05-09T19:12:03.224Z",
"updated_at": "2023-05-09T19:12:03.224Z"
}
Delete a webhook
URL
DELETE https://<your-account>.helpjuice.com/api/v3/webhooks/:id
Best Practices
- Secure Your Endpoint: Ensure that the URL receiving webhook payloads is secure and can handle incoming POST requests.
- Validate Payloads: Implement validation to verify that incoming requests are from Helpjuice to prevent unauthorized access.
- Monitor Webhook Activity: Regularly monitor the activity of your webhooks to ensure they are functioning as expected.