Skip to content

send_whats_app_conversion_event

send_whats_app_conversion_event(
    id: LinkedWhatsAppBusinessAccountId,
    dataset_id: WhatsAppDatasetId,
    event_data: WhatsAppConversionEventBlob,
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
) -> SendWhatsAppConversionEventOutput

Sends a conversion event to Meta's Conversions API for the specified WhatsApp Business Account dataset.

Parameters:

Raises:

Source code in docs_src/capo_socialmessaging/_services/social_messaging.py
def send_whats_app_conversion_event(
    self,
    id: "capo_socialmessaging.types.linked_whats_app_business_account_id.LinkedWhatsAppBusinessAccountId",
    dataset_id: "capo_socialmessaging.types.whats_app_dataset_id.WhatsAppDatasetId",
    event_data: "capo_socialmessaging.types.whats_app_conversion_event_blob.WhatsAppConversionEventBlob",
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
) -> "capo_socialmessaging.types.send_whats_app_conversion_event_output.SendWhatsAppConversionEventOutput":
    """<p>Sends a conversion event to Meta's Conversions API for the specified WhatsApp Business Account dataset.</p>

    Args:
        id: <p>The ID of the WhatsApp Business Account associated with the dataset, formatted as <code>waba-01234567890123456789012345678901</code>.</p>
        dataset_id: <p>The Meta-generated dataset ID to send the event to.</p>
        event_data: <p>The raw Meta Conversions API event payload as a JSON blob. See <a href="https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event">Meta's server event parameters</a> for the supported format.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_socialmessaging.types.send_whats_app_conversion_event_input.SendWhatsAppConversionEventInput]",
    ) -> OperationResponse[
        "capo_socialmessaging.types.send_whats_app_conversion_event_output.SendWhatsAppConversionEventOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.send_whats_app_conversion_event

        output, http_response = (
            capo_socialmessaging._operations.social_messaging.send_whats_app_conversion_event.send_whats_app_conversion_event(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_socialmessaging.types.send_whats_app_conversion_event_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SendWhatsAppConversionEvent", redact_input=_redact_input),
    )
    input_: capo_socialmessaging.types.send_whats_app_conversion_event_input.SendWhatsAppConversionEventInput = {
        "id": id,
        "dataset_id": dataset_id,
        "event_data": event_data,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output