Skip to content

WebHooks implementation #45

Description

@ysavourel

The webhook defined are not linked to a specific job or task or asset.
So how do we know which one to call when for example a taskUpdated event occurs?

Let's say a client creates 2 jobs, with each 2 assets which have 1 tasks. that gives us 4 tasks:

  • /jobs/1/assets/11/tasks/111
  • /jobs/1/assets/12/tasks/121
  • /jobs/2/assets/21/tasks/211
  • /jobs/2/assets/22/tasks/221

Let's say we create one webhook for that client:

  • /webhook/1 (eventType=taskUpdated)

Let say task 211 is updated:
The TAPICC server would go through the list of all webhooks for that client, find the ones for taskUpdated and fire them. Most likely there will be only one webhook for taskUpdated per client (but it's not specified anywhere).

For the client to be able to do anything meaningful either:

  • the payload of the request is defined by TAPICC and includes the information about the event triggered (like the task object)
  • or the URL of the webhook include one or more variables that is filled by TAPICC with the corresponding values for that event. Something like: https://myclient.com/tappic/callbacks/taskupdated?jobId={jobId}&taskId={taskId} which the server would send as https://myclient.com/tappic/callbacks/taskupdated?jobId=2&taskId=211
  • or both: the task object is send as payload and the URL has variables (this may allow the client to avoid doing a call to the server). Most likely the client need more information since the taskUpdated is a rather generic event.

Also we would need to decide what kind of call is to be send: a POST, PUT or GET. Or have that information in the webhook properties.

Another question: Are the event types too generic?
Would it make sense to have only types of event corresponding to changes meaningful for the client? (e.g. when a task is paused, the client may not care about it: the lone task event that most clients will be watching for is when the task is done or fails)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions