In this Help doc
Create a New Webhook Endpoint
Click Settings
Expand your Organization
Click Webhooks
Click New Webhook Endpoint
Enter the name of the webhook
Enter the webhook URL
Select the desired Event Types:
graph.created
graph.deleted
graph.updated (this refers to graph settings, not values)
knowledge_item.created
knowledge_item.deleted
knowledge_item.updated
member.created
member.deleted
member.updated
position.created
position.deleted
position.updated
team.created
team.deleted
team.updated
Click Create Webhook Endpoint
Your Webhook Endpoint is displayed
Normally, after creating the Webhook endpoint, this area will be empty. Once you start creating, updating or deleting data relevant to the event types you've chosen, the events will appear here.
Edit a Webhook Endpoint
Click Settings
Expand your Organization
Click Webhooks
Click the Webhook Endpoint
Click Edit Endpoint
Update the desired data
Click Update Webhook Endpoint
Delete a Webhook Endpoint
Click Settings
Expand your Organization
Click Webhooks
Click the Webhook Endpoint
Click Edit Endpoint
Click Delete Endpoint
Get the Signing Secret
Click Settings
Expand your Organization
Click Webhooks
Click the Webhook Endpoint
Click Reveal
Validate a Webhook Request
As a necessary security practice, you should validate the webhook request to ensure a webhook is coming from MetaPulse. To do that, you will need to generate a signature and compare it to the MetaPulse-Signature
request header. Here's how:
Get the Signing Secret from MetaPulse after configuring the webhook endpoint there.
Combine the
MetaPulse-Request-Timestamp
request header with the request body joined by a period (.
). It will look like this:1721173157.{id: "abc123", ...}
Use OpenSSL HMAC to generate a SHA256 hexdigest using the Signing Secret and the combined timestamp and body.
Compare the result with the
MetaPulse-Signature
header.
Example Ruby code:
signing_secret = "..."
timestamp = request.headers["MetaPulse-Request-Timestamp"]
body = request.body.read
signature = OpenSSL::HMAC.hexdigest("SHA256", signing_secret, "#{timestamp}.#{body}")
if signature == request.headers["MetaPulse-Signature"]
# Valid request
else
# Invalid request
end