sinch.domains.conversation.api.v1.events_apis module

class sinch.domains.conversation.api.v1.events_apis.Events(sinch)[source]

Bases: BaseConversation

send(
app_id: str,
event: AppEventDict,
contact_id: str | None = None,
recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
event_destination_target: str | None | Unset = <sinch.core.sentinel.Unset object>,
channel_priority_order: Literal['WHATSAPP',
'RCS',
'SMS',
'MESSENGER',
'VIBERBM',
'MMS',
'INSTAGRAM',
'TELEGRAM',
'KAKAOTALK',
'KAKAOTALKCHAT',
'LINE',
'WECHAT',
'APPLEBC'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)]] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
event_metadata: str | None | Unset = <sinch.core.sentinel.Unset object>,
queue: Literal['NORMAL_PRIORITY',
'HIGH_PRIORITY'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → SendEventResponse[source]

Sends an event to the referenced contact from the referenced app. Note that this operation enqueues the event in a queue so a successful response only indicates that the event has been queued.

Parameters:
  • app_id (str) – The ID of the app sending the event.

  • event (AppEventDict) – The event to be sent. Set exactly one event type key.

  • contact_id (Optional[str]) – The ID of the recipient contact. Either contact_id or recipient_identities must be provided.

  • recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – Channel identities of the recipient. Either contact_id or recipient_identities must be provided.

  • event_destination_target (UnsetOr[Optional[str]]) – Overwrites the default event destination target for delivery receipts for this event.

  • channel_priority_order (UnsetOr[Optional[List[ConversationChannelType]]]) – Optional. A single element array that dictates on what channel should the Conversation API try to send the event.

  • event_metadata (UnsetOr[Optional[str]]) – Optional. Metadata that should be associated to the event.

  • queue (UnsetOr[Optional[MessageQueueType]]) – Select the priority type for the event.

  • **kwargs –

    Additional parameters for the request.

Returns:

The accepted event.

Return type:

SendEventResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

get(
event_id: str,
**kwargs,
) → ConversationEventResponse[source]

Get event from ID.

Parameters:
  • event_id (str) – The unique ID of the event.

  • **kwargs –

    Additional parameters for the request.

Returns:

The event.

Return type:

ConversationEventResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

delete(event_id: str, **kwargs) → None[source]

Delete a specific event by its ID.

Parameters:
  • event_id (str) – The unique ID of the event.

  • **kwargs –

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

list(
conversation_id: str | None = None,
contact_id: str | None = None,
page_size: int | None = None,
page_token: str | None = None,
**kwargs,
) → Paginator[ListEventsResponse, ConversationEventResponse][source]

List all events in a project.

Parameters:
  • conversation_id (Optional[str]) – Resource name (id) of the conversation. One of conversation_id or contact_id needs to be present.

  • contact_id (Optional[str]) – Resource name (id) of the contact. One of conversation_id or contact_id needs to be present.

  • page_size (Optional[int]) – Maximum number of events to fetch. Defaults to 10 and the maximum is 20.

  • page_token (Optional[str]) – Next page token previously returned if any.

  • **kwargs –

    Additional parameters for the request.

Returns:

A paginator for iterating through the events.

Return type:

Paginator[ListEventsResponse, ConversationEventResponse]

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.