wxc_sdk.webhook package

Webhook types and API

class wxc_sdk.webhook.WebhookEventType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

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

migrated = 'migrated'

A room was migrated to a different geography. The roomId has changed.

all = 'all'
class wxc_sdk.webhook.WebhookResource(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

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'
all = 'all'
class wxc_sdk.webhook.WebhookStatus(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

active = 'active'
inactive = 'inactive'
class wxc_sdk.webhook.Webhook(*, id: str | None = None, name: str, targetUrl: str, resource: WebhookResource | None = None, event: WebhookEventType | None = None, filter: str | None = None, secret: str | None = None, status: WebhookStatus, created: datetime, orgId: str | None = None, createdBy: str | None = None, appId: str | None = None, ownedBy: str | None = None)[source]

Bases: ApiModel

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

webhook_id: str | None

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: WebhookResource | None

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

event: WebhookEventType | None

The event type for the Webhook.

filter: str | None

The filter that defines the webhook scope.

secret: str | None

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: str | None
created_by: str | None
app_id: str | None
owned_by: str | None
property app_id_uuid: str
property webhook_id_uuid: str
property org_id_uuid: str
property created_by_uuid: str
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'app_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='appId', alias_priority=1), 'created': FieldInfo(annotation=datetime, required=True, alias='created', alias_priority=1), 'created_by': FieldInfo(annotation=Union[str, NoneType], required=False, alias='createdBy', alias_priority=1), 'event': FieldInfo(annotation=Union[WebhookEventType, NoneType], required=False, alias='event', alias_priority=1), 'filter': FieldInfo(annotation=Union[str, NoneType], required=False, alias='filter', alias_priority=1), 'name': FieldInfo(annotation=str, required=True, alias='name', alias_priority=1), 'org_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='orgId', alias_priority=1), 'owned_by': FieldInfo(annotation=Union[str, NoneType], required=False, alias='ownedBy', alias_priority=1), 'resource': FieldInfo(annotation=Union[WebhookResource, NoneType], required=False, alias='resource', alias_priority=1), 'secret': FieldInfo(annotation=Union[str, NoneType], required=False, alias='secret', alias_priority=1), 'status': FieldInfo(annotation=WebhookStatus, required=True, alias='status', alias_priority=1), 'target_url': FieldInfo(annotation=str, required=True, alias='targetUrl', alias_priority=1), 'webhook_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class wxc_sdk.webhook.WebhookEventData(**extra_data: Any)[source]

Bases: WebhookEventDataForbid

base class for data components of a webhook event. Subclasses of this base implement the actual data models

Examples

resource

class

telephony_calls

wxc_sdk.telephony.calls.TelephonyEventData

messages

wxc_sdk.messages.MessagesData

memberships

wxc_sdk.memberships.MembershipsData

attachmentActions

wxc_sdk.attachment_actions.AttachmentActionsApi

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

class Config[source]

Bases: object

extra = 'allow'
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'allow', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class wxc_sdk.webhook.WebhookEvent(*, id: str | None = None, name: str, targetUrl: str, resource: WebhookResource | None = None, event: WebhookEventType | None = None, filter: str | None = None, secret: str | None = None, status: WebhookStatus, created: datetime, orgId: str | None = None, createdBy: str | None = None, appId: str | None = None, ownedBy: str | None = None, actorId: str | None = None, data: WebhookEventDataForbid | dict)[source]

Bases: Webhook

A webhook event. Can be used in to parse data posted to a webhook handler

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

actor_id: str | None
data: WebhookEventDataForbid | dict

resource specific event data; for registered subclasses of wwx_sdk.webhook.WebhookEventData an instance of this subclass is returned. If no class is registered for the given resource, then data is returned as generic WebhookEventData instance

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'actor_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='actorId', alias_priority=1), 'app_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='appId', alias_priority=1), 'created': FieldInfo(annotation=datetime, required=True, alias='created', alias_priority=1), 'created_by': FieldInfo(annotation=Union[str, NoneType], required=False, alias='createdBy', alias_priority=1), 'data': FieldInfo(annotation=Union[WebhookEventDataForbid, dict], required=True, alias='data', alias_priority=1), 'event': FieldInfo(annotation=Union[WebhookEventType, NoneType], required=False, alias='event', alias_priority=1), 'filter': FieldInfo(annotation=Union[str, NoneType], required=False, alias='filter', alias_priority=1), 'name': FieldInfo(annotation=str, required=True, alias='name', alias_priority=1), 'org_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='orgId', alias_priority=1), 'owned_by': FieldInfo(annotation=Union[str, NoneType], required=False, alias='ownedBy', alias_priority=1), 'resource': FieldInfo(annotation=Union[WebhookResource, NoneType], required=False, alias='resource', alias_priority=1), 'secret': FieldInfo(annotation=Union[str, NoneType], required=False, alias='secret', alias_priority=1), 'status': FieldInfo(annotation=WebhookStatus, required=True, alias='status', alias_priority=1), 'target_url': FieldInfo(annotation=str, required=True, alias='targetUrl', alias_priority=1), 'webhook_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class wxc_sdk.webhook.WebhookApi(*, session: RestSession, base: str | None = 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: WebhookEventType, filter: str | None = None, secret: str | None = None, owned_by: str | None = 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

class wxc_sdk.webhook.WebhookCreate(*, name: str, targetUrl: str, resource: WebhookResource, event: WebhookEventType, filter: str | None = None, secret: str | None = None, ownedBy: str | None = None)[source]

Bases: ApiModel

Body for a webhook create call

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

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

name: str
target_url: str
resource: WebhookResource
event: WebhookEventType
filter: str | None
secret: str | None
owned_by: str | None
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'event': FieldInfo(annotation=WebhookEventType, required=True, alias='event', alias_priority=1), 'filter': FieldInfo(annotation=Union[str, NoneType], required=False, alias='filter', alias_priority=1), 'name': FieldInfo(annotation=str, required=True, alias='name', alias_priority=1), 'owned_by': FieldInfo(annotation=Union[str, NoneType], required=False, alias='ownedBy', alias_priority=1), 'resource': FieldInfo(annotation=WebhookResource, required=True, alias='resource', alias_priority=1), 'secret': FieldInfo(annotation=Union[str, NoneType], required=False, alias='secret', alias_priority=1), 'target_url': FieldInfo(annotation=str, required=True, alias='targetUrl', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.