Setting up Webhooks

Webhooks can be configured in the Webhook section of your Teamwork Projects Site Settings. First you must enabled Webhooks for your Teamwork Projects account. You can then register a URL for each type of Event you’d like to receive notifications about.

Take a look below, if you go to settings on your Teamwork Projects site, you will see webhooks. Inside here, you can enable them and then go ahead and create webhooks. You can enter your URL endpoint here.

Setting up Version 2 Webhooks

When creating your webhook using the steps above, make sure you select Version2 of the webhooks option. You can configure different content-type, if you’re used to working with our old webhooks - select Form

Tokens and Checksums on Version 2

The token field in your webhooks setup allows you to implement an additional security feature for your webhook consumer. We use the specified token to calculate a sha256 checksum of the webhook payload and send it in the X-Projects-Signature header. You can use the same token to generate a checksum of the data on your end and compare the two checksums. You can find many examples online how to calculate this checksum, but here’s our implementation in Go:

func generateSignature(data string, token string) (string, error) {
    sig := hmac.New(sha256.New, []byte(token))
    if _, err := sig.Write([]byte(data)); err != nil {
        return "", err
    }
    return hex.EncodeToString(sig.Sum(nil)), nil
} 

Feedback

If you have any feedback or suggestions, feel free to contact us at api@teamwork.com.