Send a Message

Base URI

https://secure.telemessage.com

Endpoint

POST /partners/xmlMessage.jsp
Sends a message via TeleMessage service.

 

Let’s send message via the TeleMessage XML API.

First, we need to create XML with sender authentication details, message content and recipient (see examples on right side below) and then by using your favorite programmatic language to send this XML to the TeleMessage XML API endpoint (see few examples on left side below).

 

 

 

 

 

 

 

 

 

* You can test your XML code here or track message delivery status here.

 

XML STRUCTURE                                                                                                          CODE SAMPLE

 

 

 

Simple Text Messages 

 

<?xml version="1.0" encoding="UTF-8" ?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>enter your subject here</SUBJECT>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>enter your user name here</USER_NAME>
                            <PASSWORD>enter your password here</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>enter your text here</TEXT>
                </TEXT_MESSAGE>
            </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="SMS"/>
                        <DEVICE_VALUE>16173190666</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.6</VERSION>
</TELEMESSAGE>

Note: <SUBJECT>enter your subject here</SUBJECT> – is only applicable for email messages; keep empty for all other message types. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

           

 

Messages to Multiple Recipients

Assuming that you want to send message to more than one recipient, simply add additional DEVICE_INFORMATION element into USER_TO CIML element.

<?xml version="1.0" encoding="UTF-8" ?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>enter your subject here</SUBJECT>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>enter your user name here</USER_NAME>
                            <PASSWORD>enter your password here</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>enter your text here</TEXT>
                </TEXT_MESSAGE>
            </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="MobileNumber"/>
                        <DEVICE_VALUE>16173190666</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="SMS"/>
                        <DEVICE_VALUE>16173190666</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="EmailAddress"/>
                        <DEVICE_VALUE>test@telemessage.com</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.6</VERSION>
</TELEMESSAGE> 

 

 

Schedule Messages

In case you want to schedule sending message to be sent at specific times, you can do it by adding SCHEDULE_TO element into MESSAGE_INFORMATION element. Date format must be following: YYYYMMDD HH:MM:SS.

<?xml version="1.0" encoding="UTF-8" ?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>enter your subject here</SUBJECT>
                <SCHEDULE_TO>20040701 18:30:00</SCHEDULE_TO>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>enter your user name here</USER_NAME>
                            <PASSWORD>enter your password here</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>enter your text here</TEXT>
                </TEXT_MESSAGE>
            </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="SMS"/>
                        <DEVICE_VALUE>16173190666</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.6</VERSION>
</TELEMESSAGE>

 

 

 

 

 

import java.io.*;
import java.io.FileInputStream;
import javax.mail.internet.MimeUtility;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
import org.apache.commons.httpclient.methods.PostMethod;


 	public static void main(String[] args) {
 	try {
 		// Get target URL
String strURL = "https://secure.telemessage.com/partners/xmlMessage.jsp";
InputStream xmlin =null;

*//Send xml file (read a local xml file and send it)
String strXMLFilename = "add your file path here" ;
File input = new File(strXMLFilename);
xmlin = new FileInputStream(input);

//Prepare HTTP post
PostMethod post = new PostMethod(strURL);

//Request content will be retrieved directly 
/// from the input stream
post.setRequestBody(xmlin);

//Per default, the request content needs to be buffered
// in order to determine its length.
// Request body buffering can be avoided when
// = content length is explicitly specified
// = chunk-encoding is used
if (input.length() < Integer.MAX_VALUE) {
post.setRequestContentLength((int)input.length());
} else {
post.setRequestContentLength(EntityEnclosingMethod.CONTENT_LENGTH_CHUNKED);
}

//Specify content type and encoding
// If content encoding is not explicitly specified
// ISO-8859-1 is assumed
post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");

//Get HTTP client
HttpClient httpclient = new HttpClient();

//Execute request
int result = httpclient.executeMethod(post);

//Display status code
System.out.println("Response status code: " + result);

//Display response
String responseStr = post.getResponseBodyAsString();
System.out.println("Response body: ");
System.out.println(responseStr);

//Release current connection to the connection pool once you are done
post.releaseConnection();
 	
 } catch (Exception e) {
 	 System.out.println(e.getMessage()); 
       }
}
Sub main()

 Dim objHTTP As New MSXML.XMLHTTPRequest
 Dim strMessage As String
 Dim strReturn As String
 Dim objReturn As New MSXML.DOMDocument

 'Create the string to send
 strMessage = "enter your XML message here" (see XML templates)

 'Set up to post to our server
 objHTTP.open("post", "https://secure.telemessage.com/partners/xmlMessage.jsp", False)

 'Set a standard XML header for the content-type
 objHTTP.setRequestHeader("Content-Type", "text/xml")

 'Send the message
 objHTTP.send(strMessage)

 'Get the return response
 strReturn = objHTTP.responseText

 'Load the return response into a DOM
 objReturn.loadXML(strReturn)

 'Write the return response
 Console.WriteLine(strReturn)

End Sub 
$xmlstring = "<?xml........"; 

    //creating header for http post request
    $myHeader = array(
        "MIME-Version: 1.0",
        "Content-type: text/xml; charset=utf-8"
    );
    //creating and initiating curl
    $ch = curl_init();
    //setting curl/http headers
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlstring);
    curl_setopt($ch, CURLOPT_URL, " https://secure.telemessage.com/partners/xmlMessage.jsp ");
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $myHeader);
    //executing http request and getting response. $postResult will contain response xml from TeleMessage.
    $postResult = curl_exec($ch);
    if (curl_errno($ch)) {
        return null;
        /*
        * for PHP5 you can throw Exception:
        * throw new Exception("Error while sending");
        */
    }
    curl_close($ch);

    return $postResult;
}
public void sendMessage()
{

MSXML.XMLHTTPRequestobjHTTP = new MSXML.XMLHTTPRequest();
stringstrMessage = null;
stringstrReturn = null;
MSXML.DOMDocumentobjReturn = new MSXML.DOMDocument();

//Create the string to send
strMessage = "enter your XML message here" (see XML templates);

//Set up to post to our server
objHTTP.open("post",
"https://secure.telemessage.com/partners/xmlMessage.jsp", false);

//Set a standard XML header for the content-type
objHTTP.setRequestHeader("Content-Type", "text/xml");

//Send the message
objHTTP.send(strMessage);

//Get the return response
strReturn = objHTTP.responseText;

//Load the return response into a DOM
objReturn.loadXML(strReturn);

//Write the return response
Console.WriteLine(strReturn);

 

 

Sending Voice and Fax

The XML structure is the same as Simple Text Messages above, however, the DEVICE_TYPE should be changed:

DEVICE_TYPE indicates the device type in which the message will be sent.

For Sending Faxes:

<DEVICE_INFORMATION>
<DEVICE_TYPE DEVICE_TYPE="BusinessFax"/>
<DEVICE_VALUE>16173190666</DEVICE_VALUE>
</DEVICE_INFORMATION>

 

For sending VoiceCall:

<DEVICE_INFORMATION>
<DEVICE_TYPE DEVICE_TYPE="HomeNumber"/>
<DEVICE_VALUE>16173190666</DEVICE_VALUE>
</DEVICE_INFORMATION>

 

To test sending voice messages, you can use the XML emulator sample at this link

 

 

 

 

 

 

 

Messages with Attachments

Add FILE_MESSAGE element into MESSAGE_CONTENT.

Set FILE_DATA_BASE64 with file data encoded to Base64 as it appears in example below. Read more here.

<?xml version="1.0" encoding="UTF-8" ?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>enter your subject here</SUBJECT>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>enter your user name here</USER_NAME>
                            <PASSWORD>enter your password here</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>enter your text here</TEXT>
                </TEXT_MESSAGE>
                <FILE_MESSAGE>
                    <MESSAGE_INDEX>1</MESSAGE_INDEX>
                    <FILE_NAME>message.gif</FILE_NAME>
                    <MIME_TYPE>image/gif</MIME_TYPE>
                    <FILE_DATA>
                        <FILE_DATA_BASE64>
                            R0lGODlhEgASAMT/AP////X5r+rq6t7e3tra2s
                            7Ozr29va2trZycnJSUlG
                            9vb2tra2dnZ0ZGRjo6
                            OikpKSUlJ SEhIR0dHQA AAMDAwAAAAAAAAAA 
                            AAAAAAAAAAAAAAAAAAAA
                            AAAAAAAAAAAAAACH5BAEA ABQALAAAA 
                            AASABIAQAVbICWO ZF
                            lOQZoeghpMhSnP1PQwn
                            rso400BOwKAwGKMZRajAQXIIGCCIFOyX 
                            q05Hg4J2y 34jsehGHgK
                            7AaqgUPxKiLTjwakoL
                            q+qy57DZ93UxIKgYKDCglfYIhHIQA7
                        </FILE_DATA_BASE64>
                    </FILE_DATA>
                </FILE_MESSAGE>
            </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="MMS"/>
                        <DEVICE_VALUE>16173190666</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.6</VERSION>
</TELEMESSAGE>

In order to send a message with a file attachment, you should encode your file to Base64 encoding.

The following application demonstrate how to read a file located on your local disk, encode it to Base64 and write the encoded file as a new file. Read more here.

public static void main(String[] args) {

        //initialize input and output file name
        String strInputFileName = "enter file name (to encode) here";
        String strOutputFileName = "enter output file name here";

        rawFileToBase64(strInputFileName, strOutputFileName);

    }

    public static boolean rawFileToBase64(String inFile, String outFile) {
        try {
            // initialize inputFile
            FileInputStream fin = new FileInputStream(inFile);
            BufferedInputStream bis = new FBufferedInputStream(fin);

            // initialize outputFile
            FileOutputStream fos = new FileOutputStream(outFile);
            OutputStream os = MimeUtility.encode(fos, "base64");
            BufferedOutputStream bos = new BufferedOutputStream(os);

            byte data[] = new new byte[1024];
            int len;

            // read the buffered stream
            while (bis.available() > 0) {
                len = bis.read(data);
                bos.write(data, 0, len);
            }

            bos.close();
            bis.close();

        } catch (Exception e) {
            System.out.println("Unable to encode the contents of the request file." + e);
        }

    }

 

Alphanumeric Sender

 
<?xml version="1.0" encoding="UTF-8" ?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>enter your subject here</SUBJECT>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>enter your user name here</USER_NAME>
                            <PASSWORD>enter your password here</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>enter your text here</TEXT>
                </TEXT_MESSAGE>
                <PROPERTY_MESSAGE>
                  <MESSAGE_INDEX>1</MESSAGE_INDEX>
                  <PROPERTY_NAME>AlphanumericSender</PROPERTY_NAME>
                  <PROPERTY_VALUE>13 Character Sender</PROPERTY_VALUE>
                </PROPERTY_MESSAGE>
            </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="SMS"/>
                        <DEVICE_VALUE>16173190666</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.6</VERSION>
</TELEMESSAGE>

For more information, please read this FAQ

 

 

 

Messages With External Message ID 

 
<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>SMS test message</SUBJECT>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>***</USER_NAME>
                            <PASSWORD>***</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <EXTERNAL_MESSAGE_ID>5555</EXTERNAL_MESSAGE_ID>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>sms message body</TEXT>
                </TEXT_MESSAGE>
            </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="SMS" />
                        <DEVICE_VALUE>****</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.34</VERSION>
</TELEMESSAGE>

The external message ID will be included in the following status response: 

<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
  <TELEMESSAGE_CONTENT>
    <MESSAGE_STATUS>
      <STATUS_ID>2501</STATUS_ID>
      <STATUS_DESCRIPTION>SMS was delivered to handset</STATUS_DESCRIPTION>
      <MESSAGE_ID>****</MESSAGE_ID>
      <EXTERNAL_MESSAGE_ID>5555</EXTERNAL_MESSAGE_ID>
      <RECIPIENT_STATUS>
        <RECIPIENT_NAME>
        </RECIPIENT_NAME>
        <DEVICE>
          <ID>****</ID>
          <TYPE>60</TYPE>
          <VALUE>****</VALUE>
          <STATUS>1500</STATUS>
          <DESCRIPTION>Message has been sent</DESCRIPTION>
          <STATUS_DATE>20160202 12:07:48</STATUS_DATE>
        </DEVICE>
        <DEVICE>
          <ID>****</ID>
          <TYPE>60</TYPE>
          <VALUE>****</VALUE>
          <STATUS>2501</STATUS>
          <DESCRIPTION>SMS was delivered to handset</DESCRIPTION>
          <STATUS_DATE>20160202 12:07:49</STATUS_DATE>
        </DEVICE>
      </RECIPIENT_STATUS>
    </MESSAGE_STATUS>
  </TELEMESSAGE_CONTENT>
  <VERSION>1</VERSION>
</TELEMESSAGE>

 

 

 

Request for Push Status

 

Customers can ask to be informed about status changes by receiving status XML to a specified URL. The following element with the requested URL must be added into the MESSAGE_CONTENT element:

<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
    <TELEMESSAGE_CONTENT>
        <MESSAGE>
            <MESSAGE_INFORMATION>
                <SUBJECT>Test Message</SUBJECT>
            </MESSAGE_INFORMATION>
            <USER_FROM>
                <CIML>
                    <NAML>
                        <LOGIN_DETAILS>
                            <USER_NAME>username</USER_NAME>
                            <PASSWORD>1234</PASSWORD>
                        </LOGIN_DETAILS>
                    </NAML>
                </CIML>
            </USER_FROM>
            <MESSAGE_CONTENT>
                <TEXT_MESSAGE>
                    <MESSAGE_INDEX>0</MESSAGE_INDEX>
                    <TEXT>TeleMessage is a great system</TEXT>
                </TEXT_MESSAGE>
		<PROPERTY_MESSAGE>
			<MESSAGE_INDEX>1</MESSAGE_INDEX>
			<PROPERTY_NAME>DeliveryReceiptURL</PROPERTY_NAME>
			<PROPERTY_VALUE>http://...</PROPERTY_VALUE>
		</PROPERTY_MESSAGE>			
           </MESSAGE_CONTENT>
            <USER_TO>
                <CIML>
                    <DEVICE_INFORMATION>
                        <DEVICE_TYPE DEVICE_TYPE="SMS" />
                        <DEVICE_VALUE>972541234567</DEVICE_VALUE>
                    </DEVICE_INFORMATION>
                </CIML>
            </USER_TO>
        </MESSAGE>
    </TELEMESSAGE_CONTENT>
    <VERSION>1.5</VERSION>
</TELEMESSAGE>

 

Note:

  • You must contact our support in order to allow the requested URL, or else statuses will not be delivered.
  • If you send a multi-recipient message, we’ll send you an update only after the message has been delivered to ALL recepients.

 

An example of the XML we’ll send to a requested URL:

<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
  <TELEMESSAGE_CONTENT>
    <MESSAGE_STATUS>
      <STATUS_ID>2501</STATUS_ID>
      <STATUS_DESCRIPTION>SMS was delivered to handset</STATUS_DESCRIPTION>
      <MESSAGE_ID>352484528</MESSAGE_ID>
      <RECIPIENT_STATUS>
        <RECIPIENT_NAME>1-xxx-xxxxxxx</RECIPIENT_NAME>
        <DEVICE>
          <TYPE>60</TYPE>
          <VALUE>1-xxx-xxxxxx</VALUE>
          <STATUS>2501</STATUS>
          <DESCRIPTION>SMS was delivered to handset</DESCRIPTION>
          <STATUS_DATE>20141027 13:24:55</STATUS_DATE>
        </DEVICE>
      </RECIPIENT_STATUS>
    </MESSAGE_STATUS>
  </TELEMESSAGE_CONTENT>
  <VERSION>1</VERSION>
</TELEMESSAGE>

After you receive the request above, you should respond with text “OK” in the body of response, or else we’ll try to send the DR again and again.

 

 

 

Responses for Sending Messages

When a message is sent, you’ll receive a response whether the message was successfully sent & delivered.

If message is queued successfully, you’ll get following response:

<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
  <TELEMESSAGE_CONTENT>
    <RESPONSE>
      <MESSAGE_ID>352425905</MESSAGE_ID>
      <MESSAGE_KEY>273323624188046607944442841476</MESSAGE_KEY>
      <RESPONSE_STATUS>100</RESPONSE_STATUS>
      <RESPONSE_STATUS_DESC>Message added successfully. Returned MessageID from db is 352425905</RESPONSE_STATUS_DESC>
    </RESPONSE>
  </TELEMESSAGE_CONTENT>
  <VERSION>1</VERSION>
</TELEMESSAGE>

If RESPONSE_STATUS is 100, means message is successfully queued by TeleMessage, so store MESSAGE_ID and MESSAGE_KEY for future querying status.

If you send invalid user credentials, you’ll receive xml with error number and description:

<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
  <TELEMESSAGE_CONTENT>
    <RESPONSE>
      <MESSAGE_ID>0</MESSAGE_ID>
      <MESSAGE_KEY>
      </MESSAGE_KEY>
      <RESPONSE_STATUS>300</RESPONSE_STATUS>
      <RESPONSE_STATUS_DESC>Error while parsing XML: User (grinfeld5) doesn't exist</RESPONSE_STATUS_DESC>
    </RESPONSE>
  </TELEMESSAGE_CONTENT>
  <VERSION>1</VERSION>
</TELEMESSAGE>

For more errors and statuses see: Error & Status Codes page.

 

Note: in order to send an IP Push Notification, you would send the message as if you were sending an SMS. TeleMessage checks if the recipient has the application. If so, the message will then be sent as an IP Push Notification. Please configure whether you want to send IP Push Notifications only, or enable SMS Fallback to ensure that messages will be delivered to the recipient in case the IP Push Notification fails via the TeleMessage web portal.

 

Explore additional code samples & developer resources:

JAVA Library, PHP Library, REST API, SOAP API, HTTP API, and more.

 

 
 

 

 

 

Receiving attachments to your system over XML API

<?xml version="1.0" encoding="UTF-8"?>
<TELEMESSAGE>
  <TELEMESSAGE_CONTENT>
    <MESSAGE>
      <MESSAGE_INFORMATION>
        <LOCALE>
          <LOCALE_LANGUAGE_ID>en</LOCALE_LANGUAGE_ID>
          <LOCALE_COUNTRY_ID>US</LOCALE_COUNTRY_ID>
        </LOCALE>
        <TIME_STAMP>20160627 10:59:49</TIME_STAMP>
        <SCHEDULE_TO>20160627 10:59:49</SCHEDULE_TO>
      </MESSAGE_INFORMATION>
      <USER_FROM>
        <CIML>
          <NAML>
            <LOGIN_DETAILS>
              <USER_NAME>
              </USER_NAME>
              <PASSWORD>
              </PASSWORD>
            </LOGIN_DETAILS>
            <PERSON_DETAILS>
              <FIRST_NAME>John</FIRST_NAME>
              <LAST_NAME>Doe</LAST_NAME>
              <TIME_ZONE>GMT</TIME_ZONE>
              <STATE />
              <COUNTRY_ID />
              <GENDER>0</GENDER>
              <SERVICE_LEVEL>912</SERVICE_LEVEL>
            </PERSON_DETAILS>
          </NAML>
        </CIML>
      </USER_FROM>
      <MESSAGE_CONTENT>
        <TEXT_MESSAGE>
          <MESSAGE_INDEX>0</MESSAGE_INDEX>
          <TEXT>attachment 3</TEXT>
        </TEXT_MESSAGE>
        <FILE_MESSAGE>
          <MESSAGE_INDEX>1</MESSAGE_INDEX>
          <FILE_NAME>Telemessage-Logo.gif</FILE_NAME>
          <MIME_TYPE>image/gif</MIME_TYPE>
          <FILE_DATA>
            <FILE_DATA_BASE64>R0lGODlhGAFCAOcAAGZhYmtmaG1qbG1uc29wdHRtbnFxdXR1eXd4fH12d3l6fXx9gQCV1gCX2AGY
1wGY2AWa2Aec2Qia2Qqc2Q2d2hGe2hKf3BSf2hKg2hOg3BWg2hWg3Bih2xmi3Byj3B2k3BWx6Bu0
6iGl3SWm3Sao3imo3i2q3jGr3y6q4CS26iS46yu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MGp4hT+8MQIIQ+zNiIBG1oT+YAO4zAO5KAOJbzHUMEO
PCACkXtACVUBz8jIlnwRrmAbI3AwCZEF06NolxzKF8EN6TEBQ7Cn7oWCEGC/otzKFNEFELABBSsL
8/A1/lAPuzAFglZ/nOzKvvwQ/iAF7RNCJZADPZADJqBi9fMCU/XLzvwQqQAD7zu9glMCXcDDz5zN
CKEPspAFQ7AD1jMEWHCw2lzODGzO6JzO6rzO7NzO7vzO8BzP8jzP9KwVAQEAOw==</FILE_DATA_BASE64>
          </FILE_DATA>
        </FILE_MESSAGE>
      </MESSAGE_CONTENT>
      <USER_TO>
        <CIML>
          <NAML>
            <LOGIN_DETAILS>
              <USER_NAME>
              </USER_NAME>
              <PASSWORD>
              </PASSWORD>
            </LOGIN_DETAILS>
            <PERSON_DETAILS>
              <FIRST_NAME>John</FIRST_NAME>
              <LAST_NAME>Smith</LAST_NAME>
              <TIME_ZONE>EST</TIME_ZONE>
              <STATE />
              <COUNTRY_ID />
              <GENDER>0</GENDER>
              <SERVICE_LEVEL>912</SERVICE_LEVEL>
            </PERSON_DETAILS>
          </NAML>
          <DEVICE_INFORMATION>
            <DEVICE_TYPE DEVICE_TYPE="IP" />
            <DEVICE_VALUE>5F319DC0527423665FDE1722CC71155272B5E90DDAD52C0EDAA426B7319844F3</DEVICE_VALUE>
            <DEVICE_DESCRIPTION>1-781-4141929</DEVICE_DESCRIPTION>
          </DEVICE_INFORMATION>
        </CIML>
      </USER_TO>
    </MESSAGE>
  </TELEMESSAGE_CONTENT>
  <VERSION>1</VERSION>
</TELEMESSAGE>