Webhook class

Send event notifications with webhooks.


Overview

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.

Webhooks

info

The info attribute returns metadata of a specific webhook. The returned data type is dict

An example with info

Python

    webhook.info

  

update()

The update() function allows you to modify a specific webhook. The returned data type is dict.

ArgumentOverview
namestr
The name of the webhook.
urlstr
The URL of the webhook.
eventslist[str]
A list of events that trigger the webhook. The allowed value is order.status.
activebool
Whether this webhook should be active after the update:
  • True: webhook is active.
  • False: webhook isn’t active.
The default value is False.
secretstr
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",
)

  

delete()

The delete() function allows you to delete a registered webhook.

An example with delete()

Python

    webhook.delete()

  

Events

trigger_test_events()

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()

  

A button link with the "View repository" text on it