Receiving a webhook

Configuring your server to receive a new webhook is no different from creating any page on your website. With PHP, you might create a new .php file on your server; with a framework like Sinatra, you would add a new route with the desired URL. Remember, with webhooks, your server is the server receiving the request.

When an event occurs on your Teamwork Projects account a HTTP POST request is sent to the registered URL.

This request will contain a number of parameters in the FORM scope:

  • ‘accountId’: The ID of your Teamwork Projects account
  • ‘event’: The event triggered on your Teamwork Projects account eg.COMMENT.UPDATED
  • ‘eventCreator’: The numeric ID of the user who performed the modification
  • ‘projectId’: Some webhook events send back the project ID that the item was part of (This usually is sent back when the main item is deleted which would result in a 404 from the API such as TIME.DELETED)

The good news for using version 2 webhooks is - we’re sending quite a lot more data which means you most likely will not need to make any API calls following a webhook event.

If you still need more information, you can use the API for that, eg: For Example: GET /tasks/{objectId}.json

Feedback

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