Package com.azure.communication.messages
Class NotificationMessagesClient
java.lang.Object
com.azure.communication.messages.NotificationMessagesClient
Initializes a new instance of the synchronous NotificationMessagesClient type.
-
Method Summary
Modifier and TypeMethodDescriptioncom.azure.core.util.BinaryData
downloadMedia
(String mediaId) 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.
-
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 Name Type Required Description repeatability-request-id String No Repeatability request ID header repeatability-first-sent String No Repeatability first sent header as HTTP-date 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
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
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.
-