webhook-id
: the unique message identifier for the webhook message. This identifier is unique across all messages, but will be the same when the same webhook is being resent (e.g. due to a previous failure).webhook-timestamp
: timestamp in seconds since epoch.webhook-signature
: the Base64 encoded list of signatures (space delimited)..
). In code, it will look something like:
body
is the raw body of the request. The signature is sensitive to any changes, so even a small change in the body will cause the signature to be completely different. This means that you should not change the body in any way before verifying.
signed_content
from above using the base64 portion of your signing secret (this is the part after the whsec_
prefix) as the key. For example, given the secret whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw
you will want to use MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw
.
For example, this is how you can calculate the signature in Node.js:
webhook-signature
header.
The webhook-signature
header is composed of a list of space delimited signatures and their corresponding version identifiers. The signature list is most commonly of length one. Though there could be any number of signatures. For example:
v1,
) before verifying the signature.
Please note that to compare the signatures it’s recommended to use a constant-time string comparison method in order to prevent timing attacks.