The Webhook class enables you to view, test, and modify custom event notifications with webhooks.
Python
webhook = up42.initialize_webhook(webhook_id="d290f1ee-6c54-4b01-90e6-d701748f0851")
Additional webhook functionalities are available in the up42 class.
The info
attribute returns metadata of a specific webhook. The returned data type is dict
An example with info
Python
webhook.info
The update()
function allows you to modify a specific webhook. The returned data type is dict
.
Argument | Overview |
---|---|
name | str The name of the webhook. |
url | str The URL of the webhook. |
events | list[str] A list of events that trigger the webhook. The allowed value is order.status . |
active | bool Whether this webhook should be active after the update:
False . |
secret | str The secret used to generate webhook signatures. |
An example with update()
Python
webhook.update(
name="new-name",
url="https://new-receiving-url.com",
events=["order.status"],
active=True,
secret="RFZTJnNAChqZKNmo",
)
The delete()
function allows you to delete a registered webhook.
An example with delete()
Python
webhook.delete()
The trigger_test_events()
allows you to trigger a webhook test event to test your receiving side. The UP42 server will send test messages for each subscribed event to the specified webhook URL. The returned data type is dict
.
An example with trigger_test_events()
Python
webhook.trigger_test_events()