Class NotificationMessagesAsyncClient

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

public final class NotificationMessagesAsyncClient extends Object
Initializes a new instance of the asynchronous NotificationMessagesClient type.
  • Method Details

    • sendWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> sendWithResponse(com.azure.core.util.BinaryData notificationContent, com.azure.core.http.rest.RequestOptions requestOptions)
      Sends a notification message from Business to User.

      Header Parameters

      Header Parameters
      NameTypeRequiredDescription
      repeatability-request-idStringNoRepeatability request ID header
      repeatability-first-sentStringNoRepeatability first sent header as HTTP-date
      You can add these to a request with RequestOptions.addHeader(java.lang.String, java.lang.String)

      Request Body Schema

       
       {
           kind: String(text/image/image_v0/document/video/audio/template) (Required)
           channelRegistrationId: String (Required)
           to (Required): [
               String (Required)
           ]
       }
       
       

      Response Body Schema

       
       {
           receipts (Required): [
                (Required){
                   messageId: String (Required)
                   to: String (Required)
               }
           ]
       }
       
       
      Parameters:
      notificationContent - Details of the message to send.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      result of the send message operation along with Response on successful completion of Mono.
      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.
    • downloadMediaWithResponse

      public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> downloadMediaWithResponse(String mediaId, com.azure.core.http.rest.RequestOptions requestOptions)
      Download the Media payload from a User to Business message.

      Response Body Schema

       
       BinaryData
       
       
      Parameters:
      mediaId - The stream ID.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the response body along with Response on successful completion of Mono.
      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.
    • send

      public Mono<SendMessageResult> send(NotificationContent notificationContent)
      Sends a notification message from Business to User.
      Parameters:
      notificationContent - Details of the message to send.
      Returns:
      result of the send message operation on successful completion of Mono.
      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.
    • downloadMedia

      public Mono<com.azure.core.util.BinaryData> downloadMedia(String mediaId)
      Download the Media payload from a User to Business message.
      Parameters:
      mediaId - The stream ID.
      Returns:
      the response body on successful completion of Mono.
      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.