Last updated: Jun 26th, 2019

API Introduction

This API is designed to be an ultra simple HTTP integration specifically for SMS. For a fully featured REST API, see REST API.

If you don't have an account, you'll need to register one.

Learn more...

You'll need a new Sender/Token combo for your application.

Learn more...

The API is HTTP based. Submitting API calls creates a unique SMS message.

Delivery Reports can be provided via a Webhook to your URL, Email, or viewed with the Web Dashboard.

Learn more...

Submitted messages can be retried using the Web Dashboard, or by submitting a new API request.

Learn more...

Register your account

Head to https://www.tnz.co.nz/Customer/SignUp to create a new account.

A test account is possible, however creating a commerical account and using the Mode=Test function of the API is simpler to use when you’re ready to push your application live.

After completing the sign up form, a sales consultant will manually activate your account. This may take one business day. Once the account has been activated, you will be able to Create a new API user token.


Create a new API user token

Using the API will require a Sender and Token pair to authenticate with the API.

You can generate this using the Web Dashboard under: Users | Outbound Users | Create
User Email Address = Sender
User Token = Token


Understanding the API basics

When submitting a message via HTTP, the server will respond:
  200 OK, OK Thanks
  400 BAD REQUEST, %ERROR REASON%
  500 Internal Server Error

Once the message delivery completes, a status report can be dispatched to your software. Reply messages can also be captured.

Send SMS/TXT via HTTP


sender=application@domain.com
token=ta8wr7ymd
number=021000001
message=Hello, this is a test message from Department01. Thank you.
                                                

Required parameters

Parameter Example Value Description
sender application@domain.com Sender value set up in Create a new API user token
token ta8wr7ymd Token value set up in Create a new API user token
number 021000001 Destination mobile number in dialling format (02, 0064, +64)
message Hello, this is a test message from Department01. Thank you. Plain or UTF-8 formatted SMS message

Optional parameters

Parameter Example Value Description
MessageID ID123456 A message tracking identifier (maximum 40 characters, alphanumeric)
SMSEmailReply person.one@domain.com For email (SMTP) reply receipt notifications

Resending and retrying messages

To resend or retry sending a message via the REST API, this will need to be submitted as a new, unique message.
To resend or retry sending a message via the Web Dashboard, once logged in and viewing an individual message, you will see Resubmit and Forward buttons.


Status Reporting - Reporting and event tracking

Delivery Reports advise whether delivery was successful. If not, it will describe why.

Each delivery report type is optional and multiple delivery report times can be used.



Web Dashboard - Tracking message statuses via the online dashboard

You will be supplied with a Web Dashboard login at registration. The Dashboard can be used to set up new sender/token pairs, as well as track sent and replied messages. You can drill into specific messages to view individual events, such as delivery attempts, retries, replies, results, clicks, etc.



SMTP Email - Receive message statuses via email

Delivery reports are emailed as an HTML email for viewing by an end-user. Your sales representative can enable this for you.

Whitelabelling of SMTP Email reports is available.

The email address to receive SMS Reply reports can be specified on the original message submission using the SMSEmailReply parameter.



Webhook - Message statuses delivered via a webhook

To receive Delivery Reports via Webhook, please advise the URL to submit to.
Webhooks are provided as an HTTP POST in either XML or JSON format (your preference).

Supplied parameters are:



Parameter Example Value Description
Sender application@domain.com Webhook sender authentication (can configure a unique Sender if required)
Token ta8wr7ymd Webhook token authentication (can configure a unique Token if required)
Type SMS Type of Message ('Email', 'SMS', 'Fax', 'Voice', 'TextToSpeech', or 'SMSReply')
Destination +6421000001 Destination that the webhook is for (alphanumeric field, where telephone/mobile numbers are supplied in E.164 internationalised format)
MessageID js82hn8n MessageID parameter supplied when sending your original API call
JobNumber 10C7B9A0 Eight digit alphanumeric tracking number (our internal Job Number)
SentTime 16/10/2018 13:43 p.m. Time message was completed (Sender's local time time in 'dd/MM/yyyy HH:mm tt' format)
Status SUCCESS For submission results, values are SUCCESS, FAILED, PENDING
For reply reports, this will be RECEIVED
For additional analytics, this will be UPDATED
Result Sent OK Final delivery result and/or the cause for a message delivery failure
For reply reports, this will be RECEIVED
For additional analytics, this will be the event description
Message This is a reply. This field will only contain data if 'Type=SMSReply'
Price 0.20 Your cost for this transaction, charged by us to you
Detail SMSParts:2 Additional billing detail: "SMSParts", "FaxPages", "VoiceMinutes", "Size", "Prompts"


GET Status Poll - Track message statuses using a GET poll

API users are able to poll for the status of a message via the GET Status API.

 
 
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

{
    "Sender": "application@domain.com",
    "APIKey": "ta8wr7ymd",
    "Type": "status",
    "APIVersion": "1.02",
    "MessageID": "ID123456",
}                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

{
    "Sender": "application@domain.com",
    "APIKey": "ta8wr7ymd",
    "Type": "status",
    "APIVersion": "1.02",
    "MessageID": "ID123456",
}                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

curl --request POST \
  --url https://www.tnz.co.nz/api/json/get \
  --header "Content-Type: application/json; encoding='utf-8'" \
  --data '{
    "Sender": "application@domain.com",
    "APIKey": "ta8wr7ymd",
    "Type": "status",
    "APIVersion": "1.02",
    "MessageID": "ID123456",
  }'                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

curl --request POST \
  --url https://www.tnz.co.nz/api/json/get \
  --header "Content-Type: application/json; encoding='utf-8'" \
  --data '{
    "Sender": "application@domain.com",
    "APIKey": "ta8wr7ymd",
    "Type": "status",
    "APIVersion": "1.02",
    "MessageID": "ID123456",
  }'                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

<?php

$sender = "application@domain.com";
$apikey = "ta8wr7ymd";
$type = "status";
$version = "1.02";
$message_id = "ID123456";           // required

$data = array(
    "Sender" => $sender,
    "APIKey" => $apikey,
    "Type" => $type,
    "APIVersion" => $version,
    "MessageID" => $message_id,
);

$headers = array(
  "Content-Type: application/json",
  "encoding='utf-8'",
  "Content-length: ".strlen(json_encode($data)),
  "Connection: close"
);  

try
{
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, "https://www.tnz.co.nz/api/json/get");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    $err  = "";
    
    if(curl_errno($ch))
    {
        $err = curl_error($ch);
    }
    else
    {
        curl_close($ch);
    }   
    
    switch( $info['http_code'] )
    {
        case "200": // success;
            header('Content-Type: application/json');
            echo $response;
            break;
        case "400": // error
            header('Content-Type: application/json');
            echo $response;
            break;
        case "500": // critical error
            echo $response;
            echo $err;
            break;
        default:
            echo $response;
            echo $err;
            break;
    }
}
catch(Exception $e)
{
    echo 'Caught exception: ',  $e->getMessage();
}

?>                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

<?php

$sender = "application@domain.com";
$apikey = "ta8wr7ymd";
$type = "status";
$version = "1.02";
$message_id = "ID123456";           // required

$data = array(
    "Sender" => $sender,
    "APIKey" => $apikey,
    "Type" => $type,
    "APIVersion" => $version,
    "MessageID" => $message_id,
);

$headers = array(
  "Content-Type: application/json",
  "encoding='utf-8'",
  "Content-length: ".strlen(json_encode($data)),
  "Connection: close"
);  

try
{
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, "https://www.tnz.co.nz/api/json/get");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    $err  = "";
    
    if(curl_errno($ch))
    {
        $err = curl_error($ch);
    }
    else
    {
        curl_close($ch);
    }   
    
    switch( $info['http_code'] )
    {
        case "200": // success;
            header('Content-Type: application/json');
            echo $response;
            break;
        case "400": // error
            header('Content-Type: application/json');
            echo $response;
            break;
        case "500": // critical error
            echo $response;
            echo $err;
            break;
        default:
            echo $response;
            echo $err;
            break;
    }
}
catch(Exception $e)
{
    echo 'Caught exception: ',  $e->getMessage();
}

?>                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Net;
using System.IO;

namespace GetStatusJSON
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }
        
        private void GetStatusByJSONAPI()
        {
            string apiURL = "https://www.tnz.co.nz/api/json/get";

            string strSender = "application@domain.com";
            string strAPIKey = "ta8wr7ymd";
            string strAPIVersion = "1.02";
            string strType = "Status";
            string strMessageID = "ID123456";             // required

            string strJSONData = "{" +
                "\"Sender\": \"" + strSender + "\"," +
                "\"APIKey\": \"" + strAPIKey + "\"," +
                "\"Type\":\"" + strType + "\"," +
                "\"APIVersion\":\"" + strAPIVersion + "\"," +
                "\"MessageID\":\"" + strMessageID + "\"," +
            "}";
                        
            HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(apiURL);
            getRequest.Method = WebRequestMethods.Http.Post;
            getRequest.ContentType = "application/json; encoding='utf-8'";

            byte[] byteArray = Encoding.UTF8.GetBytes(strJSONData);
            getRequest.ContentLength = byteArray.Length;
            Stream newStream = getRequest.GetRequestStream(); //open connection
            newStream.Write(byteArray, 0, byteArray.Length); // Send the data.
            newStream.Close();

            string strResponse = "";

            HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse();
            using (StreamReader sr = new StreamReader(getResponse.GetResponseStream()))
            {
                strResponse = sr.ReadToEnd();
            }
            
            MessageBox.Show(strResponse);
        }
    }
}                                          
API URL:   https://www.tnz.co.nz/api/json/status/
HTTP Header:   Content-Type="application/json; encoding='utf-8'"

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Net;
using System.IO;

namespace GetStatusJSON
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }
        
        private void GetStatusByJSONAPI()
        {
            string apiURL = "https://www.tnz.co.nz/api/json/get";

            string strSender = "application@domain.com";
            string strAPIKey = "ta8wr7ymd";
            string strAPIVersion = "1.02";
            string strType = "Status";
            string strMessageID = "ID123456";             // required

            string strJSONData = "{" +
                "\"Sender\": \"" + strSender + "\"," +
                "\"APIKey\": \"" + strAPIKey + "\"," +
                "\"Type\":\"" + strType + "\"," +
                "\"APIVersion\":\"" + strAPIVersion + "\"," +
                "\"MessageID\":\"" + strMessageID + "\"," +
            "}";
                        
            HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(apiURL);
            getRequest.Method = WebRequestMethods.Http.Post;
            getRequest.ContentType = "application/json; encoding='utf-8'";

            byte[] byteArray = Encoding.UTF8.GetBytes(strJSONData);
            getRequest.ContentLength = byteArray.Length;
            Stream newStream = getRequest.GetRequestStream(); //open connection
            newStream.Write(byteArray, 0, byteArray.Length); // Send the data.
            newStream.Close();

            string strResponse = "";

            HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse();
            using (StreamReader sr = new StreamReader(getResponse.GetResponseStream()))
            {
                strResponse = sr.ReadToEnd();
            }
            
            MessageBox.Show(strResponse);
        }
    }
}                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <Sender>application@domain.com</Sender>
  <APIKey>ta8wr7ymd</APIKey>
  <Type>status</Type>
  <APIVersion>1.02</APIVersion>
  <MessageID>ID123456</MessageID>
</root>                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <Sender>application@domain.com</Sender>
  <APIKey>ta8wr7ymd</APIKey>
  <Type>status</Type>
  <APIVersion>1.02</APIVersion>
  <MessageID>ID123456</MessageID>
</root>                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

curl --request POST \
  --url https://www.tnz.co.nz/api/xml/get \
  --header "Content-Type: text/xml; encoding='utf-8'" \
  --data '
  <?xml version="1.0" encoding="UTF-8"?>
  <root>
    <Sender>application@domain.com</Sender>
    <APIKey>ta8wr7ymd</APIKey>
    <Type>status</Type>
    <APIVersion>1.02</APIVersion>
    <MessageID>ID123456</MessageID>
  </root>
  '                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

curl --request POST \
  --url https://www.tnz.co.nz/api/xml/get \
  --header "Content-Type: text/xml; encoding='utf-8'" \
  --data '
  <?xml version="1.0" encoding="UTF-8"?>
  <root>
    <Sender>application@domain.com</Sender>
    <APIKey>ta8wr7ymd</APIKey>
    <Type>status</Type>
    <APIVersion>1.02</APIVersion>
    <MessageID>ID123456</MessageID>
  </root>
  '                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

<?php

$sender = "application@domain.com";
$apikey = "ta8wr7ymd";
$type = "status";
$version = "1.02";
$message_id = "ID123456";           // required

$data = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><root></root>");

$data->addChild("Sender",$sender);
$data->addChild("APIKey",$apikey);
$data->addChild("Type",$type);
$data->addChild("APIVersion",$version);
$data->addChild("MessageID",$message_id);

$headers = array(
  "Content-Type: text/xml",
  "encoding='utf-8'",
  "Content-length: ".strlen($data->asXML()),
  "Connection: close"
);  

try
{
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, "https://www.tnz.co.nz/api/xml/get");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data->asXML());
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    $err  = "";
    
    if(curl_errno($ch))
    {
        $err = curl_error($ch);
    }
    else
    {
        curl_close($ch);
    }   
    
    switch( $info['http_code'] )
    {
        case "200": // success;
            header("Content-Type: text/xml; encoding='utf-8'");
            echo $response;
            break;
        case "400": // error
            header("Content-Type: text/xml; encoding='utf-8'");
            echo $response;
            break;
        case "500": // critical error
            echo $response."\n";
            echo $err;
            break;
        default:
            echo $response."\n";
            echo $err;
            break;
    }
}
catch(Exception $e)
{
    echo 'Caught exception: ',  $e->getMessage();
}

?>                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

<?php

$sender = "application@domain.com";
$apikey = "ta8wr7ymd";
$type = "status";
$version = "1.02";
$message_id = "ID123456";           // required

$data = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><root></root>");

$data->addChild("Sender",$sender);
$data->addChild("APIKey",$apikey);
$data->addChild("Type",$type);
$data->addChild("APIVersion",$version);
$data->addChild("MessageID",$message_id);

$options = array(
    'http' => array(
        'method' => 'POST',
        'content' => $data->asXML(),
        'header' => "Content-Type: text/xml; encoding='utf-8'\n"
    )
);

$headers = array(
  "Content-Type: text/xml",
  "encoding='utf-8'",
  "Content-length: ".strlen($data->asXML()),
  "Connection: close"
);  

try
{
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, "https://www.tnz.co.nz/api/xml/get");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data->asXML());
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    $err  = "";
    
    if(curl_errno($ch))
    {
        $err = curl_error($ch);
    }
    else
    {
        curl_close($ch);
    }   
    
    switch( $info['http_code'] )
    {
        case "200": // success;
            header("Content-Type: text/xml; encoding='utf-8'");
            echo $response;
            break;
        case "400": // error
            header("Content-Type: text/xml; encoding='utf-8'");
            echo $response;
            break;
        case "500": // critical error
            echo $response."\n";
            echo $err;
            break;
        default:
            echo $response."\n";
            echo $err;
            break;
    }
}
catch(Exception $e)
{
    echo 'Caught exception: ',  $e->getMessage();
}

?>                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Xml;
using System.Windows.Forms;

using System.IO;
using System.Net;

namespace TestXML
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private XmlNode addChildNode(XmlDocument xmlDoc, string name, string val)
        {
            XmlNode workingNode = xmlDoc.CreateElement(name);
            workingNode.InnerText = val;

            return workingNode;
        }
        
        private void btnSendSMS_Click(object sender, EventArgs e)
        {
            string apiURL = "https://www.tnz.co.nz/api/xml/get";

            string strSender = "application@domain.com";
            string strAPIKey = "ta8wr7ymd";
            string strType = "status";
            string strAPIVersion = "1.02";
            string strMessageID = "ID123456";           // required

            XmlDocument xmlDoc = new XmlDocument();

            XmlNode docNode = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null); // <?xml version="1.0" encoding="UTF-8"?>
            xmlDoc.AppendChild(docNode);

            XmlNode rootNode = xmlDoc.CreateElement("root");
            xmlDoc.AppendChild(rootNode);

            rootNode.AppendChild(addChildNode(xmlDoc, "Sender", strSender));
            rootNode.AppendChild(addChildNode(xmlDoc, "APIKey", strAPIKey));
            rootNode.AppendChild(addChildNode(xmlDoc, "Type", strType));
            rootNode.AppendChild(addChildNode(xmlDoc, "APIVersion", strAPIVersion));
            rootNode.AppendChild(addChildNode(xmlDoc, "MessageID", strMessageID));

            XmlNode workingNode = xmlDoc.CreateElement("Sender");

            //
            // Send Raw XML Request
            //
            HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(apiURL);
            getRequest.Method = WebRequestMethods.Http.Post;
            getRequest.ContentType = "text/xml; encoding='utf-8'";

            byte[] byteArray = Encoding.UTF8.GetBytes(xmlDoc.OuterXml);
            getRequest.ContentLength = byteArray.Length;
            Stream newStream = getRequest.GetRequestStream(); //open connection
            newStream.Write(byteArray, 0, byteArray.Length); // Send the data.
            newStream.Close();

            string strResponse = "";

            HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse();
            using (StreamReader sr = new StreamReader(getResponse.GetResponseStream()))
            {
                strResponse = sr.ReadToEnd();
            }

            MessageBox.Show(strResponse);
        }
    }
}                                          
API URL:   https://www.tnz.co.nz/api/xml/status/
HTTP Header:   Content-Type="text/xml; encoding='utf-8'"

using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Xml;
using System.Windows.Forms;

using System.IO;
using System.Net;

namespace TestXML
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private XmlNode addChildNode(XmlDocument xmlDoc, string name, string val)
        {
            XmlNode workingNode = xmlDoc.CreateElement(name);
            workingNode.InnerText = val;

            return workingNode;
        }
        
        private void btnSendSMS_Click(object sender, EventArgs e)
        {
            string apiURL = "https://www.tnz.co.nz/api/xml/get";

            string strSender = "application@domain.com";
            string strAPIKey = "ta8wr7ymd";
            string strType = "status";
            string strAPIVersion = "1.02";
            string strMessageID = "ID123456";           // required

            XmlDocument xmlDoc = new XmlDocument();

            XmlNode docNode = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null); // <?xml version="1.0" encoding="UTF-8"?>
            xmlDoc.AppendChild(docNode);

            XmlNode rootNode = xmlDoc.CreateElement("root");
            xmlDoc.AppendChild(rootNode);

            rootNode.AppendChild(addChildNode(xmlDoc, "Sender", strSender));
            rootNode.AppendChild(addChildNode(xmlDoc, "APIKey", strAPIKey));
            rootNode.AppendChild(addChildNode(xmlDoc, "Type", strType));
            rootNode.AppendChild(addChildNode(xmlDoc, "APIVersion", strAPIVersion));
            rootNode.AppendChild(addChildNode(xmlDoc, "MessageID", strMessageID));

            XmlNode workingNode = xmlDoc.CreateElement("Sender");

            //
            // Send Raw XML Request
            //
            HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(apiURL);
            getRequest.Method = WebRequestMethods.Http.Post;
            getRequest.ContentType = "text/xml; encoding='utf-8'";

            byte[] byteArray = Encoding.UTF8.GetBytes(xmlDoc.OuterXml);
            getRequest.ContentLength = byteArray.Length;
            Stream newStream = getRequest.GetRequestStream(); //open connection
            newStream.Write(byteArray, 0, byteArray.Length); // Send the data.
            newStream.Close();

            string strResponse = "";

            HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse();
            using (StreamReader sr = new StreamReader(getResponse.GetResponseStream()))
            {
                strResponse = sr.ReadToEnd();
            }

            MessageBox.Show(strResponse);
        }
    }
}                                          
Required parameters
Parameter Example Value Description
Sender application@domain.com Sender value set up in Create a new API user token
APIKey ta8wr7ymd APIKey value set up in Create a new API user token
APIVersion 1.02 Version of the REST API used
Type Status Type of this API request
MessageID ID123456 Provided Message ID

Frequently Asked Questions

Yes, full international delivery is supported.
The maximum request size supported is 20MB. This is our server side limitation. Your client side limitation may be smaller.
You can send a wide range of file types, including Microsoft Office® documents (doc, docx, ppt, pptx, xls, xlsx, etc), Openoffice/Libreoffice documents (odt, ods, etc), Adobe® documents (pdf, etc), image file types (jpg, gif, tif, bmp, etc) and more (txt, html, etc).
By default, we will limit your message to one-message-part in length (160 characters using the GSM character set, or 70 characters using Unicode/UCS-2). This can be increased, however keep in mind that you are charged per message part that is sent. See the SMS Message Parts and Concatenated SMS guide for further information.
Yes, we can provide a daily or monthly email report (as an attached CSV file) containing data on messages sent. This can be used for billing (contains costs) or for reporting (doesn’t contain costs).
Yes, encrypted submissions are accepted across the API via HTTPS. SSL/TLS is also supported for outbound email messages provided the receiving email server supports this.
Some networks support customised SMS Caller IDs. This can be configured using your Web Dashboard.
Your Fax Caller ID can be configured using your Web Dashboard.
Your Voice and TextToSpeech Caller ID is specified on a per-message basis using the 'CallerID' parameter.