Skip to content

Webhooks

upbankapi.models.Webhook #

Bases: ModelBase

Representation of a Webhook.

id: str class-attribute #

The unique identifier for this webhook.

url: str class-attribute #

The URL that this webhook is configured to POST events to.

description: Optional[str] = None class-attribute #

An optional description that was provided at the time the webhook was created.

secret_key: Optional[str] = None class-attribute #

A shared secret key used to sign all webhook events sent to the configured webhook URL.

This field is returned only once, upon the initial creation of the webhook.

created_at: datetime class-attribute #

The datetime at which this webhook was created.

ping() #

Sends a ping event to the webhook

Returns:

Type Description
WebhookEvent

The ping event response.

logs(*, limit=None, page_size=DEFAULT_PAGE_SIZE) #

Retrieves the logs for this webhook.

Parameters:

Name Type Description Default
limit int

The maximum number of records to return.

None
page_size int

The number of records to return in each page. (max appears to be 100)

DEFAULT_PAGE_SIZE

Returns:

Type Description
PaginatedList[WebhookLog]

A paginated list of the webhook logs.

delete() #

Deletes this webhook.

Returns:

Type Description
bool

True if successful, otherwise raises exception.

__repr__() #

Return the representation of the webhook.

upbankapi.models.WebhookLog #

Bases: ModelBase

Representation of a WebhookLog entry.

id: str class-attribute #

The unique identifier for this log entry.

event: WebhookEvent class-attribute #

The webhook event associated with this log entry.

response: Optional[WebhookResponse] = None class-attribute #

Information about the response that was received from the webhook URL.

status: WebhookDeliveryStatus class-attribute #

The success or failure status of this delivery attempt.

created_at: datetime class-attribute #

The datetime at which this log entry was created.

__repr__() #

Return the representation of the webhook log.

upbankapi.models.WebhookEvent #

Bases: ModelBase

Representation of a WebhookEvent.

id: str class-attribute #

The unique identifier for this event. This will remain constant across delivery retries.

type: WebhookEventType class-attribute #

The type of this event. This can be used to determine what action to take in response to the event.

created_at: datetime class-attribute #

The datetime at which this event was generated.

webhook_id: str class-attribute #

The id of the webhook that that event was sent to.

transaction_id: Optional[str] = None class-attribute #

The id of the transaction associated with this webhook.

webhook() #

Fetch the details of the associated webhook.

Returns:

Type Description
Webhook

The associated webhook.

transaction() #

Fetch the details of the associated transaction.

Returns:

Type Description
Transaction

The associated transaction.

__repr__() #

Return the representation of the webhook event.

upbankapi.models.webhooks.WebhookResponse #

Representation of a WebhookResponse.

status_code: int = data['statusCode'] instance-attribute #

The HTTP status code received in the response.

body: str = data['body'] instance-attribute #

The payload that was received in the response body.