You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/advanced-messaging/whatsapp/includes/get-started/messages-get-started-java.md
+29-28Lines changed: 29 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ To set up an environment for sending messages, take the steps in the following s
27
27
Open your terminal or command window and navigate to the directory where you would like to create your Java application. Run the following command to generate the Java project from the maven-archetype-quickstart template.
The `generate` goal creates a directory with the same name as the `artifactId` value. Under this directory, the **src/main/java** directory contains the project source code, the **src/test/java directory** contains the test source, and the **pom.xml** file is the project's Project Object Model (POM).
@@ -51,14 +51,8 @@ Open **/src/main/java/com/communication/quickstart/App.java** in a text editor,
@@ -169,14 +163,21 @@ To create a `DefaultAzureCredential` object:
169
163
170
164
NotificationMessage or MessageTemplate clients can also be created and authenticated using the endpoint and Azure Key Credential acquired from an Azure Communication Resource in the [Azure portal](https://portal.azure.com/).
result.getReceipts().forEach(r ->System.out.println("Message sent to:"+r.getTo() +" and message id:"+ r.getMessageId()));
251
+
for (MessageReceipt messageReceipt : templateMessageResult.getReceipts()) {
252
+
System.out.println("Message sent to:"+ messageReceipt.getTo() +" and message id:"+ messageReceipt.getMessageId());
253
+
}
251
254
```
252
255
253
256
Now, the user needs to respond to the template message. From the WhatsApp user account, reply to the template message received from the WhatsApp Business Account. The content of the message is irrelevant for this scenario.
@@ -275,10 +278,12 @@ Assemble then send the text message:
275
278
TextNotificationContent textContent =newTextNotificationContent(channelRegistrationId, recipientList, "“Thanks for your feedback.");
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/advanced-messaging/whatsapp/includes/get-started/messages-get-started-js.md
For more information on how to set an environment variable for your system, follow the steps at [Store your connection string in an environment variable](../../../../create-communication-resource.md#store-your-connection-string-in-an-environment-variable).
104
104
105
-
Use the `npm install` command to install the dotenv package.
106
-
107
-
```console
108
-
npm install dotenv --save
109
-
```
110
105
111
106
To instantiate a MessageClient, add the following code to the `Main` method:
console.log("Message sent to:"+receipt.to+" with message id:"+receipt.messageId);
324
315
});
325
316
} else {
@@ -332,28 +323,27 @@ if (result.status === "202") {
332
323
> [!IMPORTANT]
333
324
> To send a text message to a WhatsApp user, the WhatsApp user must first send a message to the WhatsApp Business Account. For more information, see [Start sending messages between business and WhatsApp user](#start-sending-messages-between-a-business-and-a-whatsapp-user).
334
325
335
-
To send a media message, provide a URI to an image.
336
-
As an example, create a URI:
337
-
```csharp
338
-
varuri=newUri("https://aka.ms/acsicon1");
326
+
To send a media message, provide a URL to an image. As an example,
0 commit comments