Skip to content

list_whats_app_template_library

list_whats_app_template_library(
    id: LinkedWhatsAppBusinessAccountId,
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    filters: Optional[Filter] = None,
) -> ListWhatsAppTemplateLibraryOutput

Lists templates available in Meta's template library for WhatsApp messaging.

Parameters:

  • next_token (Optional[NextToken], default: None ) –

    The token for the next page of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return per page (1-100).

  • id (LinkedWhatsAppBusinessAccountId) –

    The ID of the WhatsApp Business Account to list library templates for.

  • filters (Optional[Filter], default: None ) –

    Map of filters to apply (searchKey, topic, usecase, industry, language).

Raises:

Source code in docs_src/capo_socialmessaging/_services/social_messaging.py
def list_whats_app_template_library(
    self,
    id: "capo_socialmessaging.types.linked_whats_app_business_account_id.LinkedWhatsAppBusinessAccountId",
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
    next_token: Optional["capo_socialmessaging.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_socialmessaging.types.max_results.MaxResults"
    ] = None,
    filters: Optional["capo_socialmessaging.types.filter.Filter"] = None,
) -> "capo_socialmessaging.types.list_whats_app_template_library_output.ListWhatsAppTemplateLibraryOutput":
    """<p>Lists templates available in Meta's template library for WhatsApp messaging.</p>

    Args:
        next_token: <p>The token for the next page of results.</p>
        max_results: <p>The maximum number of results to return per page (1-100).</p>
        id: <p>The ID of the WhatsApp Business Account to list library templates for.</p>
        filters: <p>Map of filters to apply (searchKey, topic, usecase, industry, language).</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.list_whats_app_template_library_input.ListWhatsAppTemplateLibraryInput]",
    ) -> OperationResponse[
        "capo_socialmessaging.types.list_whats_app_template_library_output.ListWhatsAppTemplateLibraryOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.list_whats_app_template_library

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListWhatsAppTemplateLibrary")
    )
    input_: capo_socialmessaging.types.list_whats_app_template_library_input.ListWhatsAppTemplateLibraryInput = {
        "id": id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filters is not None:
        input_["filters"] = filters

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