Delete a Webhook
This walkthrough demonstrates how to delete a webhook. Once the webhook is deleted, the Webhooks service stops sending callbacks for it.
There is no operation that restores a deleted webhook. To receive the event again, create a new webhook.
Before You Begin
- Register an app on the APS portal.
- Acquire an access token with the
data:readanddata:writescopes, which this operation requires. See Authentication for Webhooks. - If the webhook was created outside the default
USregion, note which region it was created in. Send the delete request against that same region. See Regionalization and Data Residency.
Step 1: Identify the Webhook to Delete
To delete a webhook you need three values: its system, its event, and its hookId. All three appear in the path of the delete request.
You can obtain them in either of these ways:
- The
Locationheader (orlocationif the client uses HTTP/2) of a successful create response contains the full path of the new webhook, including all three values. - Retrieve a List of Webhooks returns
system,event, andhookIdfor each webhook, and the__self__field of each entry contains the same path.
For example, the following path identifies a webhook on the dm.version.added event in the data system:
/systems/data/events/dm.version.added/hooks/0f60f6a0-996c-11e7-abf3-51d68cff984c
Step 2: Delete the Webhook
Send a DELETE request to webhooks/v1/systems/{system}/events/{event}/hooks/{hook_id}. The request has no body.
Request
curl -X DELETE\
-v 'https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.version.added/hooks/0f60f6a0-996c-11e7-abf3-51d68cff984c'\
-H 'Authorization: Bearer bNU4P0trbQKNSzxWksLPTzSbbmUz'
Response
HTTP/1.1 204
Date: Fri, 15 Sep 2017 16:26:40 GMT
Content-Length: 0
Connection: keep-alive
A status of 204 with an empty body means the webhook was deleted successfully.
For the full description of the operation, see Delete a Webhook in the reference.
If the request returns 400, the request could not be processed, which is usually a formatting problem. Review the path and resubmit.
If the request returns 401 or 403, the authorization header was invalid, the scopes of your access token were not acceptable, or the request lacked the necessary permissions. Verify your credentials, scopes, and permissions.
If the request returns 404, the webhook was not found. Verify the system, event, and hookId values, and confirm that you are sending the request against the region the webhook was created in.
If the request returns 500, an unexpected server error occurred. Try again later.
Step 3: Verify the Deletion
Confirm the deletion in either of these ways:
- Call Get Webhook Details for the same
system,event, andhookId. The webhook is no longer found. - Retrieve your list of webhooks again, and confirm that the
hookIdis absent. See Retrieve a List of Webhooks.
For more information about diagnosing webhook status and delivery problems, see Monitoring and Troubleshooting.