Manage Webhook Details
The following page describes how to get and update webhook details, as well as how to update the webhook status.
Get Webhook Details
The Get Webhook Details endpoint enables you to retrieve webhook details using the unique identifier associated with the webhook.
Note
You can get a webhook's unique identifier from the response to the Create Webhook endpoint, or by querying the List Webhooks endpoint.
You can retrieve a webhook's details by making a GET request to the Get Webhook Details endpoint, including the webhookId in the URL. For example:
https://thredd.webhook.management/api/v1/Webhooks/{webhookId}
If successful, a 200 response is returned with details for the webhook in the endpoint. See the below example response.
{
"status": "success",
"response": {
"webhookId" : "uniqueWebhookId",
"webhookStatus": active,
"productId": 123,
"events":[101,102],
"config": {
"url": "https://client_domain.com/webhook",
"customHeader": {
"header1": "value_1",
"header2": "value_2"
}
},
"createdTime": "2024-01-24T23:20:28Z",
"lastModifiedTime": "2024-01-24T23:20:28Z"
}
More Information
- For more information on the fields in the Get Webhook Details endpoint, see Get Webhook Details - Field Descriptions
- See Get Webhook Details to view the endpoint in the API Explorer
Update Webhook Details
The Update Webhook Details endpoint enables you to update webhook details. Note that you can only update the webhook details and not the program manager associated with the webhook.
Important
When updating the webhook, you must include all fields in the request body even if they're not being updated. The full webhook details should be noted down using the Get Webhook Details endpoint before updating the webhook.
You can update a webhook's details by making a PUT request to the Update Webhook Details endpoint, including the webhookId in the URL. For example:
https://thredd.webhook.management/api/v1/Webhooks/{webhookId}
You can find an example of a Update Webhook Details request body below.
{
"productId": 12345,
"events": [101,102],
"config": {
"url": "https://client_domain.com/webhook",
"customHeaders": {
"header1": "value_1",
"header2": "value_2"
}
}
}
If successful a 200 response is returned with the updated details of the webhook.
{
"status": "success",
"response" : {
"webhookId" : "uniqueWebhookId",
"productId": 12345,
"events": [101,102],
"webhookStatus": "active",
"config": {
"url": "https://client_domain.com/webhook",
"customHeader": {
"header1": "value_1",
"header2": "value_2"
}
},
"createdTime": "2024-01-24T03:20:28Z",
"lastModifiedTime": "2024-01-24T18:20:28Z"
}
More Information
- For more information on the fields in the Update Webhook Details endpoint, see Update Webhook Details - Field Descriptions
- See Update Webhook Details to view the endpoint in the API Explorer
Update Webhook Status
The Update Webhook Status endpoint enables you to activate or unregister a webhook. You can update a webhook's status by making a PUT request to the Update Webhook Status endpoint, including the webhookId in the URL. For example:
https://thredd.webhook.management/api/v1/Webhooks/{webhookId}/status
The request must include the field webhookStatus
, which can be either set to active
or inactive
. See the following example:
{
"webhookStatus" : "inactive"
}
If successful, a 200 response is returned confirming the new webhook status.
{
"status": "success",
"response" : {
"webhookId" : "12345",
"webhookStatus" : "Webhook is inactive."
}
More Information
- For more information on the fields in the Update Webhook Status endpoint, see Update Webhook Status - Field Descriptions
- See Update Webhook Status to view the endpoint in the API Explorer
Updated about 2 months ago