Skip to content

send_outbound_web_notification async

send_outbound_web_notification(
    instance_id: InstanceId,
    browser_id: WebBrowserId,
    session_id: WebSessionId,
    expires_at: Timestamp,
    source: WebNotificationSource,
    destination: WidgetDestination,
    content: WebNotificationContent,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> SendOutboundWebNotificationResponse

Sends an outbound web notification to a customer's web browser for outbound campaigns. For more information about outbound campaigns, see Set up Connect Customer outbound campaigns.

Only the Connect Customer outbound campaigns service principal is allowed to assume a role in your account and call this API.

Parameters:

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

  • browser_id (WebBrowserId) –

    A unique identifier for the customer's web browser instance to which the notification is being sent.

  • session_id (WebSessionId) –

    A unique identifier for the customer's web session to which the notification is being sent.

  • expires_at (Timestamp) –

    The timestamp, in Unix epoch time format, at which the web notification expires. After this time, the notification is no longer delivered to the customer's browser.

  • source (WebNotificationSource) –

    The source of the web notification. A SourceCampaign object identifies the campaign and outbound request that triggered this notification.

  • destination (WidgetDestination) –

    The destination for the web notification, specifying the communication widget that delivers the notification and the customer profile of the recipient.

  • content (WebNotificationContent) –

    The content of the web notification, including the notification type, the view to render, and any optional attributes used to populate it.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def send_outbound_web_notification(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    browser_id: "capo_connect.types.web_browser_id.WebBrowserId",
    session_id: "capo_connect.types.web_session_id.WebSessionId",
    expires_at: "capo_connect.types.timestamp.Timestamp",
    source: "capo_connect.types.web_notification_source.WebNotificationSource",
    destination: "capo_connect.types.widget_destination.WidgetDestination",
    content: "capo_connect.types.web_notification_content.WebNotificationContent",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> "capo_connect.types.send_outbound_web_notification_response.SendOutboundWebNotificationResponse":
    """<p>Sends an outbound web notification to a customer's web browser for outbound campaigns. For more information about outbound campaigns, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-outbound-campaigns.html">Set up Connect Customer outbound campaigns</a>.</p> <note> <p>Only the Connect Customer outbound campaigns service principal is allowed to assume a role in your account and call this API.</p> </note>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        browser_id: <p>A unique identifier for the customer's web browser instance to which the notification is being sent.</p>
        session_id: <p>A unique identifier for the customer's web session to which the notification is being sent.</p>
        expires_at: <p>The timestamp, in Unix epoch time format, at which the web notification expires. After this time, the notification is no longer delivered to the customer's browser.</p>
        source: <p>The source of the web notification. A <code>SourceCampaign</code> object identifies the campaign and outbound request that triggered this notification.</p>
        destination: <p>The destination for the web notification, specifying the communication widget that delivers the notification and the customer profile of the recipient.</p>
        content: <p>The content of the web notification, including the notification type, the view to render, and any optional attributes used to populate it.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.send_outbound_web_notification_request.SendOutboundWebNotificationRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.send_outbound_web_notification_response.SendOutboundWebNotificationResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.send_outbound_web_notification

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.send_outbound_web_notification.async_send_outbound_web_notification(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SendOutboundWebNotification")
    )
    input_: capo_connect.types.send_outbound_web_notification_request.SendOutboundWebNotificationRequest = {
        "instance_id": instance_id,
        "browser_id": browser_id,
        "session_id": session_id,
        "expires_at": expires_at,
        "source": source,
        "destination": destination,
        "content": content,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output