Class MessageTemplateClient

java.lang.Object
com.azure.communication.messages.MessageTemplateClient

public final class MessageTemplateClient extends Object
Initializes a new instance of the synchronous MessageTemplateClient type.
  • Method Details

    • listTemplates

      public com.azure.core.http.rest.PagedIterable<com.azure.core.util.BinaryData> listTemplates(String channelId, com.azure.core.http.rest.RequestOptions requestOptions)
      List all templates for given Azure Communication Services channel.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      maxpagesizeIntegerNoNumber of objects to return per page.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

       
       {
           kind: String(whatsApp) (Required)
           name: String (Required)
           language: String (Required)
           status: String(approved/rejected/pending/paused) (Required)
       }
       
       
      Parameters:
      channelId - The registration ID of the channel.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      paged collection of MessageTemplateItem items as paginated response with PagedIterable.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listTemplates

      public com.azure.core.http.rest.PagedIterable<MessageTemplateItem> listTemplates(String channelId)
      List all templates for given Azure Communication Services channel.
      Parameters:
      channelId - The registration ID of the channel.
      Returns:
      paged collection of MessageTemplateItem items as paginated response with PagedIterable.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      com.azure.core.exception.ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      com.azure.core.exception.ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      com.azure.core.exception.ResourceModifiedException - thrown if the request is rejected by server on status code 409.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.