What You Can Do with the SMS API

Our SMS Service API provides you with the tools to send SMS messages, check their delivery status, and cost. Whether you’re developing a communication platform, a notification system, or simply want to reach your users via SMS, our API has you covered.

The SMS API leverages the HTTP protocol, which is very popular and supported by a vast majority of applications and programming languages. This makes it seamless to integrate our API into your existing systems and projects.

With our API, you can harness the power of HTTP to make secure requests and receive structured responses, allowing you to send SMS messages efficiently, track their delivery, and manage your messaging expenses.

Whether you’re an experienced developer or just getting started, our SMS API’s simplicity and compatibility with HTTP will help you achieve your communication goals effectively.

How to Get Access to SMS API

To access our SMS API, you’ll need an authentication token. Please contact our sales team to obtain your unique client token. This token will ensure secure and authorized access to our API endpoints.

How to Send an SMS

Sending an SMS is easy with our API. You’ll need to make an HTTP POST or GET request to the /sms/send endpoint. Include the sender’s and receiver’s phone numbers, the message text, and the data coding scheme of the message (GSM, UCS or SMS). Remember to include your authentication token obtained from our sales team. Here’s a basic example using cURL, Java, nodeJS and PHP:

  • cURL POST
curl -X POST "https://atlascommunications-api.com/sms/send" \
-H "Content-Type: application/json" \
-d '{
  "auth": "your-auth-token-from-support",
  "sender": "+1234567890",
  "receiver": "+9876543210",
  "text": "Hello from SMS API!",
  "dcs": "SMS"
}'
  • cURL GET
  • curl "https://atlascommunications-api.com/sms/send?auth=your-auth-token-from-support&sender=+1234567890&receiver=+9876543210&text=Hello from SMS API&dcs=SMS"
    • Java
    OkHttpClient client = new OkHttpClient().newBuilder()
      .build();
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, """
         {
             "data": {
                 "auth": "your-auth-token-from-support",
                 "sender": "+1234567890",
                 "receiver": "+9876543210",
                 "text": "Hello from SMS API!",
                 "dcs": "SMS"             
             }
         }
     """);
    Request request = new Request.Builder()
      .url("https://atlascommunications-api.com/sms/send")
      .method("POST", body)
      .addHeader("Content-Type", "application/json")
      .build();
    Response response = client.newCall(request).execute();
    
    • NodeJS
    var axios = require('axios');
    var data = JSON.stringify({
      "data": {
         "auth": "your-auth-token-from-support",
         "sender": "+1234567890",
         "receiver": "+9876543210",
         "text": "Hello from SMS API!",
         "dcs": "SMS"   
      }
    });
    
    var config = {
      method: 'post',
      url: 'https://atlascommunications-api.com/sms/send',
      headers: { 
        'Content-Type': 'application/json'
      },
      data : data
    };
    
    axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });
    
    • PHP
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, [
      CURLOPT_URL => 'https://atlascommunications-api.com/sms/send',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => '',
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 0,
      CURLOPT_FOLLOWLOCATION => true,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_POSTFIELDS =>'{
        "data": {
             "auth": "your-auth-token-from-support",
             "sender": "+1234567890",
             "receiver": "+9876543210",
             "text": "Hello from SMS API!",
             "dcs": "SMS" 
        }
    }',
      CURLOPT_HTTPHEADER => [   
        'Content-Type: application/json'
      ],
    ]);
    
    $response = curl_exec($curl);
    
    curl_close($curl);
    echo $response;
    
    ?>
    

    Required Fields For Sending Messages

    • auth: The unique client token issued by support.
    • sender: The sender of the message
    • receiver: The number of the recipient
    • text: The text of the message encoded in UTF-8
    • dcs: The message coding; GSM for GSM messages, UCS for Unicode messages or SMS for non encoded messages.

    When you successfully send an SMS using the API, you’ll receive a response with the following fields:

    • msgId: The unique message ID associated with the sent SMS. This ID can be used to track and identify the message.
    • numParts: The number of message parts the SMS was divided into, if applicable. Long messages can be split into multiple parts for delivery.
    • totalCost: The total cost of sending the SMS, taking into account all its parts and any associated charges.
    • clientBalance: Your current client balance after deducting the cost of sending the SMS.
    • clientCurrency: The currency for the charges.

    Here’s a sample response in JSON format:

    {
      "msgId": "abc123",
      "numParts": 1,
      "totalCost": 0.25,
      "clientBalance": 50.75,
      "clientCurrency": "EUR"
    }
    

    How to Check If an SMS Got Delivered

    Checking the delivery status of an SMS is crucial for maintaining effective communication. To do this, make a GET request to the /sms/dlr endpoint. Include your authentication token obtained from our support team and the message ID you want to check. You’ll receive information about whether the message was delivered, along with relevant timestamps.

    curl "https://atlascommunications-api.com/sms/dlr?auth=your-auth-token-from-support&messageId=your-message-id"
    

    The response from the API will include the following fields:

    • msgId: The unique message ID associated with the SMS.
    • event: The delivery event, indicating whether the message was delivered.
    • numParts: The number of message parts.
    • sendTime: The timestamp when the SMS was sent.
    • dlrTime: The timestamp when the delivery status was recorded.

    Here’s a sample response in JSON format:

    {
      "msgId": "abc123",
      "event": "delivered",
      "numParts": 1,
      "sendTime": "2023-08-12T14:00:00Z",
      "dlrTime": "2023-08-12T15:30:00Z"
    }
    

    How to Receive an SMS

    To receive SMS you will need to have a website that can receive HTTP messages or connect via SMPP. HTTP Messages can be sent from our system as a POST or GET request and contain the sender,receiver, message text, message id and encoding of the message itself.