- 13 Apr 2021
- 2 Minutes to read
-
Print
-
DarkLight
-
PDF
Webhook Management API
- Updated on 13 Apr 2021
- 2 Minutes to read
-
Print
-
DarkLight
-
PDF
The Webhook API offers a simple mechanism for creating, modifying, and deleting webhooks in ProGet.
This API endpoint should be used instead of the Native API Methods when possible, as they are much easier to use and will likely not change.
For security and simplicity, these endpoints require that an API Key is created and passed into each request.
Webhook Object Data Specification
Property | Format |
---|---|
name |
A string of the user-defined name of the webhook. |
id |
An integer of the system-assigned webhook Id |
feedId |
An integer that the webhook is associated with, or null if the webhook applies to all feeds |
url |
A string containing the URL that the webhook will interact with when the event occurs. |
event |
A string of the event to listen to; one of: added , promoted , deployed , deleted , or purged |
condition |
A string containing the predicate expression that will be evaluated prior to running, or null if the webhook should always fire |
payload |
An object with the following properties:
|
List Webhooks Endpoint
GET /api/webhooks/list?key=«api-key»[&feedId=«feed-id»]
Lists webhooks, optionally filtering by feed. This endpoint returns a status of 200 (on success) or 403 (invalid key).
On success, an array of Webhooks objects will be returned, filtered by the specified feed id.
Delete Webhook Endpoint
DELETE or POST /api/webhooks/delete?key=«api-key»&id=«webhook-id»
Deletes the specified webhook. This endpoint returns a status of 200 (success), 400 (invalid webhook id), 403 (invalid key).
On success, the webhook is deleted.
Create Webhook Endpoint
PUT or POST /api/webhooks/create?key=«api-key»
Creates a webhook based on the webhook JSON object specified in the body of the request. Note that if you supply a id
property in the webhook object, it will be ignored and a new webhook will be created. This endpoint returns a status of 201 (on success), 400 (invalid webhook object), or 403 (invalid key).
On success, the specified Webhook will be created, and the system-assigned webhook id will be written to the body of the request.
Edit Webhook Endpoint
PUT or PATCH or POST /api/webhooks/edit?key=«api-key»[&id=«webhook-id»]
Updates properties of a webhook based on properties specified in a webhook JSON object sent as the body of the request. A webhook id must be specified, either in the query string or as an id
property in the webhook object. This endpoint returns a status of 200 (on success), 400 (invalid webhook object), 404 (id not found), or 403 (invalid key).
On success, the properties specified for the webhook will be updated.