wxc_sdk.webhook package

Webhook types and API

class wxc_sdk.webhook.WebHookEvent(value)[source]

Bases: str, Enum

The event type for the webhook.

created = 'created'

an object was created

updated = 'updated'

an object was updated

deleted = 'deleted'

an object was deleted

started = 'started'

a meeting was started

ended = 'ended'

a meeting was ended

joined = 'joined'

a participant joined

left = 'left'

a participant left

all = 'all'
class wxc_sdk.webhook.WebHookResource(value)[source]

Bases: str, Enum

The resource type for the webhook. Creating a webhook requires ‘read’ scope on the resource the webhook is for.

attachment_actions = 'attachmentActions'
memberships = 'memberships'
messages = 'messages'
rooms = 'rooms'
telephony_calls = 'telephony_calls'
telephony_mwi = 'telephony_mwi'
meetings = 'meetings'
recordings = 'recordings'
meeting_participants = 'meetingParticipants'
meeting_transcripts = 'meetingTranscripts'
class wxc_sdk.webhook.WebHookCreate(*, name: str, targetUrl: str, resource: WebHookResource, event: WebHookEvent, filter: str = None, secret: str = None, ownedBy: str = None)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

name: str
target_url: str
resource: WebHookResource
event: WebHookEvent
filter: Optional[str]
secret: Optional[str]
owned_by: Optional[str]
class wxc_sdk.webhook.WebHookStatus(value)[source]

Bases: str, Enum

An enumeration.

active = 'active'
inactive = 'inactive'
class wxc_sdk.webhook.WebHook(*, id: str = None, name: str, targetUrl: str, resource: WebHookResource = None, event: WebHookEvent = None, filter: str = None, secret: str = None, status: WebHookStatus, created: datetime, orgId: str = None, createdBy: str = None, appId: str = None, ownedBy: str = None)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

webhook_id: Optional[str]

The unique identifier for the webhook.

name: str

A user-friendly name for the webhook.

target_url: str

The URL that receives POST requests for each event.

resource: Optional[WebHookResource]

The resource type for the webhook. Creating a webhook requires ‘read’ scope on the resource the webhook is for.

event: Optional[WebHookEvent]

The event type for the webhook.

filter: Optional[str]

The filter that defines the webhook scope.

secret: Optional[str]

The secret used to generate payload signature.

status: WebHookStatus

The status of the webhook. Use active to reactivate a disabled webhook.

created: datetime

The date and time the webhook was created.

org_id: Optional[str]
created_by: Optional[str]
app_id: Optional[str]
owned_by: Optional[str]
property app_id_uuid: str
property webhook_id_uuid: str
property org_id_uuid: str
property created_by_uuid: str
class wxc_sdk.webhook.WebhookApi(*, session: RestSession, base: Optional[str] = None)[source]

Bases: ApiChild

API for webhook management

list() Generator[WebHook, None, None][source]

List all of your webhooks.

Returns

yields webhooks

create(name: str, target_url: str, resource: WebHookResource, event: WebHookEvent, filter: Optional[str] = None, secret: Optional[str] = None, owned_by: Optional[str] = None) WebHook[source]

Creates a webhook.

Parameters
  • name – A user-friendly name for the webhook.

  • target_url – The URL that receives POST requests for each event.

  • resource – The resource type for the webhook. Creating a webhook requires ‘read’ scope on the resource the webhook is for.

  • event – The event type for the webhook.

  • filter – The filter that defines the webhook scope.

  • secret – The secret used to generate payload signature.

  • owned_by – Specified when creating an org/admin level webhook. Supported for meetings, recordings and meetingParticipants resources for now.

Returns

the new webhook

details(webhook_id: str) WebHook[source]

Get Webhook Details Shows details for a webhook, by ID.

Parameters

webhook_id (str) – The unique identifier for the webhook.

Returns

Webhook details

update(webhook_id: str, update: WebHook) WebHook[source]

Updates a webhook, by ID. You cannot use this call to deactivate a webhook, only to activate a webhook that was auto deactivated. The fields that can be updated are name, targetURL, secret and status. All other fields, if supplied, are ignored.

Parameters
  • webhook_id (str) – The unique identifier for the webhook.

  • update (WebHook) – The webhook update

Returns

updated WebHook object

webhook_delete(webhook_id: str)[source]

Deletes a webhook, by ID.

Parameters

webhook_id (str) – The unique identifier for the webhook.

Returns

None

base = 'webhooks'
session: RestSession

REST session