Notification Messages Operations - Send
Sends a notification message from Business to User.
POST {endpoint}/messages/notifications:send?api-version=2024-08-30
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
The communication resource, for example https://my-resource.communication.azure.com |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| Repeatability-Request-ID |
string |
An opaque, globally-unique, client-generated string identifier for the request. |
|
| Repeatability-First-Sent |
string (date-time) |
Specifies the date and time at which the request was first created. |
|
| x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
Request Body
The request body can be one of the following:
| Name | Description |
|---|---|
|
Audio |
A request to send an audio notification. |
|
Document |
A request to send a document notification. |
|
Image |
A request to send an image notification. |
|
Media |
@deprecated A request to send an image notification. |
|
Template |
A request to send a template notification. |
|
Text |
A request to send a text notification. |
|
Video |
A request to send a video notification. |
AudioNotificationContent
A request to send an audio notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind | True |
string:
audio |
The type discriminator describing a message type. |
| mediaUri | True |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
DocumentNotificationContent
A request to send a document notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind | True |
string:
document |
The type discriminator describing a message type. |
| mediaUri | True |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
| caption |
string |
Optional text content. |
|
| fileName |
string |
Optional name for the file. |
ImageNotificationContent
A request to send an image notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind | True |
string:
image |
The type discriminator describing a message type. |
| mediaUri | True |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
| caption |
string |
Optional text content. |
MediaNotificationContent
@deprecated A request to send an image notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind | True |
string:
image_v0 |
The type discriminator describing a message type. |
| mediaUri | True |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
| content |
string |
Optional text content. |
TemplateNotificationContent
A request to send a template notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind | True |
string:
template |
The type discriminator describing a message type. |
| template | True |
The template object used to create templates. |
|
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
TextNotificationContent
A request to send a text notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| content | True |
string |
Message content. |
| kind | True |
string:
text |
The type discriminator describing a message type. |
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
VideoNotificationContent
A request to send a video notification.
| Name | Required | Type | Description |
|---|---|---|---|
| channelRegistrationId | True |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind | True |
string:
video |
The type discriminator describing a message type. |
| mediaUri | True |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to | True |
string[] |
The native external platform user identifiers of the recipient. |
| caption |
string |
Optional text content. |
Responses
| Name | Type | Description |
|---|---|---|
| 202 Accepted |
The request has been accepted for processing, but processing has not yet completed. Headers
|
|
| Other Status Codes |
An unexpected error response. Headers x-ms-error-code: string |
Security
AadOauth2Auth
The Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Token URL:
https://login.microsoftonline.com/common/oauth2/token
Scopes
| Name | Description |
|---|---|
| https://communication.azure.com/.default |
Authorization
Type:
apiKey
In:
header
Examples
Sends a notification message - audio
Sample request
POST https://my-resource.communication.azure.com/messages/notifications:send?api-version=2024-08-30
{
"channelRegistrationId": "0f0eb78e-a576-1dfc-b414-0f0756de3338",
"to": [
"14250000000"
],
"kind": "audio",
"mediaUri": "https://example.com/audio.mp3"
}
Sample response
{
"receipts": [
{
"messageId": "320fc2a1-4c4b-4387-9c1a-bd38b57795de",
"to": "14250000000"
}
]
}
Sends a notification message - document
Sample request
POST https://my-resource.communication.azure.com/messages/notifications:send?api-version=2024-08-30
{
"channelRegistrationId": "0f0eb78e-a576-1dfc-b414-0f0756de3338",
"to": [
"14250000000"
],
"kind": "document",
"mediaUri": "https://example.com/document.pdf",
"caption": "check out this document!",
"fileName": "fileName.pdf"
}
Sample response
{
"receipts": [
{
"messageId": "320fc2a1-4c4b-4387-9c1a-bd38b57795de",
"to": "14250000000"
}
]
}
Sends a notification message - image
Sample request
POST https://my-resource.communication.azure.com/messages/notifications:send?api-version=2024-08-30
{
"channelRegistrationId": "0f0eb78e-a576-1dfc-b414-0f0756de3338",
"to": [
"14250000000"
],
"kind": "image",
"mediaUri": "https://example.com/image.jpg",
"caption": "check out this image!"
}
Sample response
{
"receipts": [
{
"messageId": "320fc2a1-4c4b-4387-9c1a-bd38b57795de",
"to": "14250000000"
}
]
}
Sends a notification message - Template
Sample request
POST https://my-resource.communication.azure.com/messages/notifications:send?api-version=2024-08-30
{
"channelRegistrationId": "0f0eb78e-a576-1dfc-b414-0f0756de3338",
"to": [
"14250000000"
],
"kind": "template",
"template": {
"name": "example",
"language": "en",
"values": [
{
"name": "userName",
"kind": "text",
"text": "John Doe"
},
{
"name": "orderNumber",
"kind": "text",
"text": "12345"
}
],
"bindings": {
"body": [
{
"refValue": "userName"
},
{
"refValue": "orderNumber"
}
],
"kind": "whatsApp"
}
}
}
Sample response
{
"receipts": [
{
"messageId": "320fc2a1-4c4b-4387-9c1a-bd38b57795de",
"to": "14250000000"
}
]
}
Sends a notification message - text
Sample request
POST https://my-resource.communication.azure.com/messages/notifications:send?api-version=2024-08-30
{
"channelRegistrationId": "0f0eb78e-a576-1dfc-b414-0f0756de3338",
"to": [
"14250000000"
],
"kind": "text",
"content": "Text message through CPM"
}
Sample response
{
"receipts": [
{
"messageId": "320fc2a1-4c4b-4387-9c1a-bd38b57795de",
"to": "14250000000"
}
]
}
Sends a notification message - video
Sample request
POST https://my-resource.communication.azure.com/messages/notifications:send?api-version=2024-08-30
{
"channelRegistrationId": "0f0eb78e-a576-1dfc-b414-0f0756de3338",
"to": [
"14250000000"
],
"kind": "video",
"mediaUri": "https://example.com/video.mp4",
"caption": "check out this video!"
}
Sample response
{
"receipts": [
{
"messageId": "320fc2a1-4c4b-4387-9c1a-bd38b57795de",
"to": "14250000000"
}
]
}
Definitions
| Name | Description |
|---|---|
|
Audio |
A request to send an audio notification. |
|
Azure. |
The error object. |
|
Azure. |
A response containing error details. |
|
Azure. |
An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. |
|
Communication |
The type of message. |
|
Document |
A request to send a document notification. |
|
Image |
A request to send an image notification. |
|
Media |
@deprecated A request to send an image notification. |
|
Message |
Receipt of the sending one message. |
|
Message |
The template object used to create templates. |
|
Message |
The type of the message template. |
|
Message |
The message template's document value information. |
|
Message |
The message template's image value information. |
|
Message |
The message template's location value information. |
|
Message |
The message template's quick action value information. |
|
Message |
The message template's text value information. |
|
Message |
The type of the template parameter. |
|
Message |
The message template's video value information. |
|
Send |
Result of the send message operation. |
|
Template |
A request to send a template notification. |
|
Text |
A request to send a text notification. |
|
Video |
A request to send a video notification. |
|
Whats |
The WhatsApp button sub type. |
|
Whats |
The template bindings for WhatsApp |
|
Whats |
The template bindings component button for WhatsApp |
|
Whats |
The template bindings component for WhatsApp |
AudioNotificationContent
A request to send an audio notification.
| Name | Type | Description |
|---|---|---|
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind |
string:
audio |
The type discriminator describing a message type. |
| mediaUri |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to |
string[] |
The native external platform user identifiers of the recipient. |
Azure.Core.Foundations.Error
The error object.
| Name | Type | Description |
|---|---|---|
| code |
string |
One of a server-defined set of error codes. |
| details |
An array of details about specific errors that led to this reported error. |
|
| innererror |
An object containing more specific information than the current object about the error. |
|
| message |
string |
A human-readable representation of the error. |
| target |
string |
The target of the error. |
Azure.Core.Foundations.ErrorResponse
A response containing error details.
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
Azure.Core.Foundations.InnerError
An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
| Name | Type | Description |
|---|---|---|
| code |
string |
One of a server-defined set of error codes. |
| innererror |
Inner error. |
CommunicationMessageKind
The type of message.
| Value | Description |
|---|---|
| text |
Text message type. |
| image |
Image message type. |
| image_v0 |
Image message type. Legacy image type for |
| document |
Document message type. |
| video |
Video message type. |
| audio |
Audio message type. |
| template |
Template message type. |
DocumentNotificationContent
A request to send a document notification.
| Name | Type | Description |
|---|---|---|
| caption |
string |
Optional text content. |
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| fileName |
string |
Optional name for the file. |
| kind |
string:
document |
The type discriminator describing a message type. |
| mediaUri |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to |
string[] |
The native external platform user identifiers of the recipient. |
ImageNotificationContent
A request to send an image notification.
| Name | Type | Description |
|---|---|---|
| caption |
string |
Optional text content. |
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind |
string:
image |
The type discriminator describing a message type. |
| mediaUri |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to |
string[] |
The native external platform user identifiers of the recipient. |
MediaNotificationContent
@deprecated A request to send an image notification.
| Name | Type | Description |
|---|---|---|
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| content |
string |
Optional text content. |
| kind |
string:
image_v0 |
The type discriminator describing a message type. |
| mediaUri |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to |
string[] |
The native external platform user identifiers of the recipient. |
MessageReceipt
Receipt of the sending one message.
| Name | Type | Description |
|---|---|---|
| messageId |
string |
The message id. |
| to |
string |
The native external platform user identifier of the recipient. |
MessageTemplate
The template object used to create templates.
| Name | Type | Description |
|---|---|---|
| bindings | MessageTemplateBindings: |
The binding object to link values to the template specific locations |
| language |
string |
The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'. |
| name |
string |
Name of the template. |
| values | MessageTemplateValue[]: |
The template values. |
MessageTemplateBindingsKind
The type of the message template.
| Value | Description |
|---|---|
|
The WhatsApp template type. |
MessageTemplateDocument
The message template's document value information.
| Name | Type | Description |
|---|---|---|
| caption |
string |
The [optional] caption of the media object. |
| fileName |
string |
The [optional] filename of the media file. |
| kind |
string:
document |
The type discriminator describing a template parameter type. |
| name |
string |
Template binding reference name |
| url |
string (uri) |
The (public) URL of the media. |
MessageTemplateImage
The message template's image value information.
| Name | Type | Description |
|---|---|---|
| caption |
string |
The [optional] caption of the media object. |
| fileName |
string |
The [optional] filename of the media file. |
| kind |
string:
image |
The type discriminator describing a template parameter type. |
| name |
string |
Template binding reference name |
| url |
string (uri) |
The (public) URL of the media. |
MessageTemplateLocation
The message template's location value information.
| Name | Type | Description |
|---|---|---|
| address |
string |
The [Optional] address of the location. |
| kind |
string:
location |
The type discriminator describing a template parameter type. |
| latitude |
number (double) |
The latitude of the location. |
| locationName |
string |
The [Optional] name of the location. |
| longitude |
number (double) |
The longitude of the location. |
| name |
string |
Template binding reference name |
MessageTemplateQuickAction
The message template's quick action value information.
| Name | Type | Description |
|---|---|---|
| kind |
string:
quick |
The type discriminator describing a template parameter type. |
| name |
string |
Template binding reference name |
| payload |
string |
The [Optional] quick action payload |
| text |
string |
The [Optional] quick action text |
MessageTemplateText
The message template's text value information.
| Name | Type | Description |
|---|---|---|
| kind |
string:
text |
The type discriminator describing a template parameter type. |
| name |
string |
Template binding reference name |
| text |
string |
The text value. |
MessageTemplateValueKind
The type of the template parameter.
| Value | Description |
|---|---|
| text |
The text template parameter type. |
| image |
The image template parameter type. |
| document |
The document template parameter type. |
| video |
The video template parameter type. |
| location |
The location template parameter type. |
| quickAction |
The quick action template parameter type. |
MessageTemplateVideo
The message template's video value information.
| Name | Type | Description |
|---|---|---|
| caption |
string |
The [optional] caption of the media object. |
| fileName |
string |
The [optional] filename of the media file. |
| kind |
string:
video |
The type discriminator describing a template parameter type. |
| name |
string |
Template binding reference name |
| url |
string (uri) |
The (public) URL of the media. |
SendMessageResult
Result of the send message operation.
| Name | Type | Description |
|---|---|---|
| receipts |
Receipts of the send message operation. |
TemplateNotificationContent
A request to send a template notification.
| Name | Type | Description |
|---|---|---|
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind |
string:
template |
The type discriminator describing a message type. |
| template |
The template object used to create templates. |
|
| to |
string[] |
The native external platform user identifiers of the recipient. |
TextNotificationContent
A request to send a text notification.
| Name | Type | Description |
|---|---|---|
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| content |
string |
Message content. |
| kind |
string:
text |
The type discriminator describing a message type. |
| to |
string[] |
The native external platform user identifiers of the recipient. |
VideoNotificationContent
A request to send a video notification.
| Name | Type | Description |
|---|---|---|
| caption |
string |
Optional text content. |
| channelRegistrationId |
string (uuid) |
The Channel Registration ID for the Business Identifier. |
| kind |
string:
video |
The type discriminator describing a message type. |
| mediaUri |
string (uri) |
A media url for the file. Required if the type is one of the supported media types, e.g. image |
| to |
string[] |
The native external platform user identifiers of the recipient. |
WhatsAppMessageButtonSubType
The WhatsApp button sub type.
| Value | Description |
|---|---|
| quickReply |
The WhatsApp button sub type is quick reply. |
| url |
The WhatsApp button sub type is url. |
WhatsAppMessageTemplateBindings
The template bindings for WhatsApp
| Name | Type | Description |
|---|---|---|
| body |
The body template bindings |
|
| buttons |
The button template bindings |
|
| footer |
The footer template bindings |
|
| header |
The header template bindings |
|
| kind |
string:
whats |
The type discriminator describing a template bindings type. |
WhatsAppMessageTemplateBindingsButton
The template bindings component button for WhatsApp
| Name | Type | Description |
|---|---|---|
| refValue |
string |
The name of the referenced item in the template values. |
| subType |
The WhatsApp button sub type |
WhatsAppMessageTemplateBindingsComponent
The template bindings component for WhatsApp
| Name | Type | Description |
|---|---|---|
| refValue |
string |
The name of the referenced item in the template values. |