Class NotificationMessagesClient

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

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

    Modifier and Type
    Method
    Description
    com.azure.core.util.BinaryData
    Download the Media payload from a User to Business message.
    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.
    send(NotificationContent notificationContent)
    Sends a notification message from Business to User.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • sendWithResponse

      public 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.
      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 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.
      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 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.
      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 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.
      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.