Creating a Webhook

Creating a Webhook

A webhook can be created via:
POST https://api.getguru.com/api/v1/webhooks

Fields:

  • deliveryMode
    • SINGLE - events will be delivered as simple json objects, one at a time. this mode is not generally recommended as higher frequency events may cause delivery backups.
    • BATCH - one or more events are delivered in a json envelope. this mode is generally recommended as it allows for more efficient event delivery, especially in the case of higher frequencies of events.
  • targetUrl - the url which will receive the events. must be "https".
  • status
    • ENABLED - the webhook will be active as soon as it is created
    • DISABLED - the webhook will not be active until the status is explicitly set to ENABLED (see Changing the Status of a Webhook below)
  • filter - one or more event types separated by commas. The types of events which should be delivered to this webook. Currently, at most 10 event types may be included in a single webhook.

Example request:

{
    "deliveryMode":"BATCH",
    "targetUrl":"https://someserver.com/",
    "status":"ENABLED",
    "filter":"card-created"
}

Example Response:

{
    "owner": {
        "status": "ACTIVE",
        "email": "[email protected]",
        "firstName": "bob",
        "lastName": "smith",
        "profilePicUrl": "https://lh3.googleusercontent.com/a-/bob"
    },
    "filter": "card-created",
    "id": "b6109be3-9b86-4fb3-ae1a-5faa94b4fc97",
    "status": "ENABLED",
    "deliveryMode": "BATCH",
    "dateCreated": "2021-05-10T17:05:32.245+0000",
    "team": {
        "id": "17724bbf-b6b2-4f78-b3db-91188cac3444",
        "status": "ACTIVE",
        "dateCreated": "2019-11-05T18:48:38.821+0000",
        "profilePicUrl": "https://assets.getguru.com/default-team-logo.png",
        "name": "TestImageTeam"
    },
    "dateLastModified": "2021-05-10T17:05:32.245+0000",
    "targetUrl": "https://someserver.com/"
}

Getting a Webhook

At any point in time, the owner may retrieve one or all of their webhooks via:

  • GET https://api.getguru.com/api/v1/webhooks
    • Gets all currently configured webhooks for the user
    • The response will be a JSON array where each element looks the same as that in Creating a Webhook above
  • GET https://api.getguru.com/api/v1/webhooks/{webhookId}
    • Gets the webhook with the given ID for the user
    • The response will look the same as that in Creating a Webhook above