-
Request the current project webhooks.
Request:
// GET https://subdomain.cop.blackduck.com/api/notifications/v0/project-webhooks/150cd9f0-ef40-434b-b862-2a97cd884a1eThis request submits a
project idto get the webhooks associated with the project.{ "data": [ { "type": "project-webhook", "id": "150cd9f0-ef40-434b-b862-2a97cd884a1e", "attributes": { "webhook-ids": [ "c605f908-dfe4-11e9-8a34-2a2ae2dbcce4", "c282254d-0881-413d-a314-c91c592d391f", "f8441c8f-f399-45d5-a680-536ecc6375aa" ] } } ], "included": [], } }The array stored in
webhook-idscontains three ids. On the next step, you can remove or add ids if there are additional webhooks you'd like to use. -
Update the preceding
project-webhookassociation by removing one or more webhooks.- Remove or add webhooks.
- Remove the
project-webhookassociation .
This step includes multiple examples, but you only need one.
Request: Add or Remove Webhooks
PATCH /project-webhooks/150cd9f0-ef40-434b-b862-2a97cd884a1e { "data": { "type": "project-webhook", "id": "150cd9f0-ef40-434b-b862-2a97cd884a1e", "attributes": { "webhook-ids": [ "c605f908-dfe4-11e9-8a34-2a2ae2dbcce4", "c282254d-0881-413d-a314-c91c592d391f", ] } } }This request sends a patch that changes the database record by removing the last
webhook-id("f844..." in the first code example). That webhook is no longer associated with the project. You can add or remove as many webhooks as necessary in a single request.Request: Remove All Existing Webhooks
PATCH /project-webhooks/150cd9f0-ef40-434b-b862-2a97cd884a1e { "data": { "type": "project-webhook", "id": "150cd9f0-ef40-434b-b862-2a97cd884a1e", "attributes": { "webhook-ids": [ ] } } }This example sends a request with an empty array for the
webhooks-idvalue, removing all the existing webhooks from the project.Request: Delete Project Webhook Association
DELETE /project-webhooks/150cd9f0-ef40-434b-b862-2a97cd884a1eThis example accepts the
project id, removing all the existing webhooks from the project.Note: Deleting aproject-webhookobject removes the relationships but not the object. If aproject-webhookis queried after it is deleted, it returns theproject-webhookwith an empty list of webhook ids.