Skip to content

send_whats_app_call_event async

send_whats_app_call_event(
    origination_phone_number_id: WhatsAppPhoneNumberId,
    meta_api_version: str,
    call_event: WhatsAppCallEventBlob,
    *,
    config_overrides: Optional[AsyncSocialMessagingClientConfig] = None,
) -> SendWhatsAppCallEventOutput

Sends a WhatsApp calling event, such as connecting or terminating a call, for a business phone number. This operation passes the event through to Meta. To use this operation, the origination phone number must belong to a WhatsApp Business Account that is linked to your Amazon Web Services account.

Parameters:

  • origination_phone_number_id (WhatsAppPhoneNumberId) –

    The unique identifier of the origination phone number for the call. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's ID.

  • meta_api_version (str) –

    The version of the Meta Graph API to use for the request.

  • call_event (WhatsAppCallEventBlob) –

    The call event payload to send, as a JSON blob in the format defined by the Meta calling API.

Raises:

Source code in docs_src/capo_socialmessaging/_services/async_social_messaging.py
async def send_whats_app_call_event(
    self,
    origination_phone_number_id: "capo_socialmessaging.types.whats_app_phone_number_id.WhatsAppPhoneNumberId",
    meta_api_version: str,
    call_event: "capo_socialmessaging.types.whats_app_call_event_blob.WhatsAppCallEventBlob",
    *,
    config_overrides: Optional[AsyncSocialMessagingClientConfig] = None,
) -> "capo_socialmessaging.types.send_whats_app_call_event_output.SendWhatsAppCallEventOutput":
    """<p>Sends a WhatsApp calling event, such as connecting or terminating a call, for a business phone number. This operation passes the event through to Meta. To use this operation, the origination phone number must belong to a WhatsApp Business Account that is linked to your Amazon Web Services account.</p>

    Args:
        origination_phone_number_id: <p>The unique identifier of the origination phone number for the call. The phone number identifiers are formatted as <code>phone-number-id-01234567890123456789012345678901</code>. Use <code>GetLinkedWhatsAppBusinessAccount</code> to find a phone number's ID.</p>
        meta_api_version: <p>The version of the Meta Graph API to use for the request.</p>
        call_event: <p>The call event payload to send, as a JSON blob in the format defined by the Meta calling API.</p>

    Raises:
        capo_socialmessaging.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_socialmessaging.errors.validation_exception.ValidationException: <p>The request contains an invalid parameter value. </p>
        capo_socialmessaging.errors.access_denied_by_meta_exception.AccessDeniedByMetaException: <p>You do not have sufficient access to perform this action.</p>
        capo_socialmessaging.errors.conflict_exception.ConflictException: <p>Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.</p>
        capo_socialmessaging.errors.dependency_exception.DependencyException: <p>Thrown when performing an action because a dependency would be broken.</p>
        capo_socialmessaging.errors.internal_service_exception.InternalServiceException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_socialmessaging.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the action are not valid.</p>
        capo_socialmessaging.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
        capo_socialmessaging.errors.throttled_request_exception.ThrottledRequestException: <p>The request was denied due to request throttling.</p>
        capo_socialmessaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_socialmessaging.types.send_whats_app_call_event_input.SendWhatsAppCallEventInput]",
    ) -> AsyncOperationResponse[
        "capo_socialmessaging.types.send_whats_app_call_event_output.SendWhatsAppCallEventOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.send_whats_app_call_event

        (
            output,
            http_response,
        ) = await capo_socialmessaging._operations.social_messaging.send_whats_app_call_event.async_send_whats_app_call_event(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_socialmessaging.types.send_whats_app_call_event_input.SendWhatsAppCallEventInput",
    ) -> dict[str, Any]:
        import capo_socialmessaging.types.send_whats_app_call_event_input

        return capo_socialmessaging.types.send_whats_app_call_event_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SendWhatsAppCallEvent", redact_input=_redact_input),
    )
    input_: capo_socialmessaging.types.send_whats_app_call_event_input.SendWhatsAppCallEventInput = {
        "origination_phone_number_id": origination_phone_number_id,
        "meta_api_version": meta_api_version,
        "call_event": call_event,
    }

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