<p>I believe you will need to do this programmatically using the AWS SDK as described in <a href="http://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html#sms_publish_sdk" rel="nofollow noreferrer">Sending a Message (AWS SDKs)</a>. Here is a quote a from it:</p>

<blockquote>
  <p>To send an SMS message by using one of AWS SDKs, use the action in
  that SDK that corresponds to the Publish request in the Amazon SNS
  API. With this request, you can send an SMS message directly to a
  phone number</p>
  
  <p>...</p>
  
  <p><strong>Sending a Message (AWS SDK for Java)</strong></p>
  
  <p>The following example uses the publish method of the AmazonSNSClient
  class to send a message directly to a phone number:</p>

<pre><code>public static void main(String[] args) {
        AmazonSNSClient snsClient = new AmazonSNSClient();
        String message = "My SMS message";
        String phoneNumber = "+1XXX5550100";
        Map&lt;String, MessageAttributeValue&gt; smsAttributes = 
                new HashMap&lt;String, MessageAttributeValue&gt;();
        //&lt;set SMS attributes&gt;
        sendSMSMessage(snsClient, message, phoneNumber, smsAttributes);
}

public static void sendSMSMessage(AmazonSNSClient snsClient, String message, 
      String phoneNumber, Map&lt;String, MessageAttributeValue&gt; smsAttributes) {
        PublishResult result = snsClient.publish(new PublishRequest()
                        .withMessage(message)
                        .withPhoneNumber(phoneNumber)
                        .withMessageAttributes(smsAttributes));
        System.out.println(result); // Prints the message ID.
</code></pre>
</blockquote>

CC BY-SA 3.0
2017-07-31T10:04:40.637Z
It does not make much sense if i need to write a code just to integrate with a an SMSC type of thing, the application code should be agnostic to the SMS service/SMS gateway/SMSC used to send SMS. I do not want to ship the delivery of the code with coded integrations for AWA- SNS.
lakshayk
CC BY-SA 3.0
2017-08-02T15:12:51.670Z
If you don't want to ship code that connects to a specific provider, then you need to write an abstraction layer and ship that separately - there's no way everyone is going to agree on a common API.
Xiong Chiamiov
CC BY-SA 3.0
2017-07-31T08:18:56.290Z
2018-01-09T12:59:40.623Z
2018-01-09T12:59:40.623Z
Mark Wragg
<p>Can we send SMS through AWS for the below case?</p>

<p>I have an application installed on Ec2 and that application runs few rules and may send SMS to end users if the rule conditions are met.</p>

<p>I wanted to integrate it with some SMSC and thought of giving a shot with AWS-SNS. However, I am not able to figure out how will i integrate my application with AWS-SNS.</p>

<p>Going through the documentation of AWS-SNS I am not sure if this can be achieved. It talks about creating topics and assigning E164 numbers to topics but does not tell us how to integrate this with our already existing application.</p>

CC BY-SA 4.0
2018-06-17T03:38:37.493Z
While SNS can work for this... you might find a particularly focused SMS service like Twilio easier to work with, particularly if you're sending messages to lots of different numbers.
Tim Malone
<amazon-web-services><amazon-cloudwatch>
How to send SMS through AWS?
lakshayk
# How to send SMS through AWS?

(Asked by: username_0 on 2017-07-31)

Can we send SMS through AWS for the below case?

I have an application installed on Ec2 and that application runs few rules and may send SMS to end users if the rule conditions are met.

I wanted to integrate it with some SMSC and thought of giving a shot with AWS-SNS. However, I am not able to figure out how will i integrate my application with AWS-SNS.

Going through the documentation of AWS-SNS I am not sure if this can be achieved. It talks about creating topics and assigning E164 numbers to topics but does not tell us how to integrate this with our already existing application.

**Tags:** amazon-web-services, amazon-cloudwatch

> **Comments:**
> **username_1**: While SNS can work for this... you might find a particularly focused SMS service like Twilio easier to work with, particularly if you're sending messages to lots of different numbers.  

---

## 1 answers

### Answer by username_2 on 2017-07-31. Score: 8

I believe you will need to do this programmatically using the AWS SDK as described in Sending a Message (AWS SDKs). Here is a quote a from it:

To send an SMS message by using one of AWS SDKs, use the action in
  that SDK that corresponds to the Publish request in the Amazon SNS
  API. With this request, you can send an SMS message directly to a
  phone number
...
Sending a Message (AWS SDK for Java)
The following example uses the publish method of the AmazonSNSClient
  class to send a message directly to a phone number:
public static void main(String[] args) {
        AmazonSNSClient snsClient = new AmazonSNSClient();
        String message = "My SMS message";
        String phoneNumber = "+1XXX5550100";
        Map smsAttributes = 
                new HashMap();
        //
        sendSMSMessage(snsClient, message, phoneNumber, smsAttributes);
}

public static void sendSMSMessage(AmazonSNSClient snsClient, String message, 
      String phoneNumber, Map smsAttributes) {
        PublishResult result = snsClient.publish(new PublishRequest()
                        .withMessage(message)
                        .withPhoneNumber(phoneNumber)
                        .withMessageAttributes(smsAttributes));
        System.out.println(result); // Prints the message ID.

> **Comments:**
> **username_0**: It does not make much sense if i need to write a code just to integrate with a an SMSC type of thing, the application code should be agnostic to the SMS service/SMS gateway/SMSC used to send SMS. I do not want to ship the delivery of the code with coded integrations for AWA- SNS.  
> **username_3**: If you don't want to ship code that connects to a specific provider, then you need to write an abstraction layer and ship that separately - there's no way everyone is going to agree on a common API.  

---

