XML Introduction

This document explains about how to use our SMS API. In order to send an SMS you need to use an HTTP post request by sending an XML stream. The response will also be sent in an XML Format.

All requests must be sent to https://my.textme.co.il/api
All responses will be according to the command request, but all look something like this:

<sms>
<status>0</status >
<message >SMS will be sent<message >
<shipment_id >xxxxxxx</shipment_id >
</sms>

The status field differs according to the result. when status is zero the request is valid and for any error the status number is the error number.The message also differs when the status is not zero, to explain the reason. The root element "sms" will change according to the command sent.

Send SMS

In order to send an SMS message you need send an XML similar to the following example:

<?xml version="1.0" encoding="UTF-8"?>
<sms>
<user>
<username>Leeroy</username>
<password>Jenkins</password>
</user>
<source>TextMe</source>
<destinations>
<cl_id>21518<cl_id>
<cl_id>21500<cl_id>
<phone id="external id1">5xxxxxxxx</phone>
<phone id="external id2">5xxxxxxxx</phone>
<phone>5xxxxxxxx</phone>
<phone id="">5xxxxxxxx</phone>
</destinations>
<message>This is a sample message</message>
<timing>30/03/14 10:10</timing>
<add_unsubscribe>0</add_unsubscribe>
<response>0</response>
</sms>

                

Fields:

  • sms - Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element.The password to your user account.
  • source - Required element. The phone number from which you wish to send the SMS message.
  • destinations - Required element. Contains all phone destinations you wish to send the SMS to. May contain multiple phone fields.
  • phone - Required element. phone number to which the SMS, must be formatted : 5xxxxxxx or 05xxxxxxx
  • id - Optional attribute. An attribute of the phone element. If you’re interested in checking for DLR’s enter your ID for the SMS to query it later. Leave blank or don’t add it if you’re not interested.
  • message - Required element. Contains the message to be sent to the destinations.
  • timing - Optional element. the date in which the sms to be sent. If absent then will send immediately.
  • response - Optional element. If you wish that the SMS will have response functionality set 1, any other value would be consider as no. This will have a random "source" number attached to the SMS and the value you wrote will be ignored.
  • Add_unsubscribe - Optional element. If you want to add SMS option for removal. Remove by link set 3, Remove by return SMS set 2, any other value would be considering as no.
  • cl_id - Optional element. If you wish send a message to a contact lists. You should enter the ID of the contact list.
In which the response will be something like :
<sms>
<status>0</status >
<message >SMS will be sent<message >
<shipment_id >xxxxxxx</shipment_id >
</sms>

Send Bulk SMS

You also have the option to send bulk SMS, which means you can send multiple individual SMS messages, in which case the XML will be something like:


<?xml version="1.0" encoding="UTF-8"?>
<bulk>
<user>
<username>Leeroy</username>
<password>Jenkins</password>
</user>
<messages>
<sms>
<source>TextMe</source>
<destinations>
<phone id="external id1">5xxxxxxxx</phone>
<phone id="external id2">5xxxxxxxx</phone>
<phone>5xxxxxxxx</phone>
<phone id="">5xxxxxxxx</phone>
</destinations>
<message>This is a sample message</message>
</sms>
<sms>
<source>TextMe</source>
<destinations>
<phone id="">5xxxxxxxx</phone>
</destinations>
<message>This is a different message sent</message>
</sms>
</messages>
<timing>08/01/17 17:10</timing>
<response>0</response>
</bulk>
                        
                    

  • response - Optional element. If you wish that all the SMS messages will have response functionality set 1, any other value would be consider as no. This will have a random "source" number attached to every SMS (same number to all of them) and the value you wrote will be ignored.
  • add_unsubscribe - Optional element. If you want to add SMS option for removal. Remove by link set 3, Remove by return SMS set 2, any other value would be consider as no.

Get Balance

If you wish to check your remaining balance send an XML similar to the following example:

<?xml version="1.0" encoding="UTF-8"?>
<balance>
<user>
<username>Leeroy</username>
<password>Jenkins</password>
</user>
</balance>
                        
                    

Fields:

  • balance- Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
In which the response will be something like :

<?xml version="1.0" encoding="UTF-8"?>
<balance>
<status>0</status>
<message>Your balance is : 42</message>
<balance>42</balance>
</balance>
                            
                    

Get Delivery Reports (DLR)

In order to get Delivery reports you must send an XML similar to the following example :


    <?xml version="1.0" encoding="UTF-8"?>
<dlr>
<user>
<username>Leeroy</username>
<password>Jenkins</password>
</user>
<transactions>
<external_id>some id 1</external_id>
<external_id>some id 2</external_id>
</transactions>
<from>01/01/14 00:00</from>
<to>01/01/14 23:59</to>
</dlr>

                        
                        

Fields:

  • dlr - Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element.The password to your user account.
  • transactions - Required element. Contains all sms destinations you wish to receive DLR’s for. May contain multiple external_id fields.
  • external_id - Required element. The id you have sent as an attribute while submitted the SMS.
  • message - Required element. Contains the message to be sent to the destinations.
  • from* - Required element. The start date to take DLR’s from. Format : dd/mm/yy hh:mm
  • to*- Required element. The end date to take DLR’s from. Format : dd/mm/yy hh:mm
* The date range that is allowed to pick from is a range of 1 week up to 1 year back

In which the response will be something like :


<?xml version="1.0" encoding="UTF-8"?>
<dlr>
<status>0</status>
<message></message>
<transactions>
<transaction>
<external_id>1391438285</external_id>
<status>102</status>
<he_message>הגיע ליעד</he_message>
<en_message>Delivered</en_message>
<date>03/02/14 16:38</date>
<shipment_id>12345678<shipment_id>
</transaction> <transaction>
<external_id>1391438286</external_id>
<status>102</status>
<he_message>דעיל עיגה</he_message>
<en_message>Delivered</en_message>
<date>03/02/14 16:38</date>
<shipment_id>12345678<shipment_id>
</transaction>
</transactions>
</dlr>


                        
                        

Get Incoming SMS

In order to get Incomings reports you must send an XML similar to the following example:


    <?xml version="1.0" encoding="UTF-8"?>
<incoming>
<user>
<username> Leeroy </username>
<password> Jenkins </password>
</user>
<from>01/01/15 00:00</from>
<to>01/01/15 23:59</to>
</incoming>
                        
                        

Fields:

  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element.The password to your user account.
  • from* - Required element. The start date to take DLR’s from. Format : dd/mm/yy hh:mm
  • to*- Required element. The end date to take DLR’s from. Format : dd/mm/yy hh:mm
*The date range that is allowed to pick from is a range of 1 week up to 1 year back
In which the response will be something like :

    <?xml version="1.0" encoding="UTF-8"?>
<incoming>
<status>0</status>
<message></message>
<transactions>
<transaction>
<source>05********</source>
<destination>05********</destination>
<message> This is a sample message</message>
<date>03/12/14 16:38</date>
</transaction >
<transaction>
<source>05********</source>
<destination>05********</destination>
<message> This is a test message</message>
<date>03/12/14 12:33</date>
</transaction>
</transactions>
</incoming>
                    
                    

Get Blacklist

If you wish to check your remaining balance send an XML similar to the following example:

 
     <?xml version="1.0" encoding="UTF-8"?>
<blacklist>
<user>
<username>XXXXXX</username>
<password>XXXXXX</password>
</user>
<from>02/06/15 00:00</from>
<to>15/12/15 23:59</to>
</blacklist>
                        
                        
Fields:
  • blacklist- Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • from* - Required element. The start date to take DLR’s from. Format: dd/mm/yy hh:mm
  • to*- Required element. The end date to take DLR’s from. Format: dd/mm/yy hh:mm
In which the response will be something like :

    <?xml version="1.0" encoding="UTF-8"?>
<blacklist>
<status>0</status>
<message></message>
<transactions>
<transaction>
<phone>5********</phone>
<date>03/12/14 16:38</date>
</transaction>
<transaction>
<phone>5********</phone>
<date>03/12/14 12:33</date>
</transaction>
</transactions>
</blacklist>
                
                

Add a number to a contact list exists

If you wish to add numbers to contact list exists an XML similar to the following example:

 
<? xml version="1.0" encoding="UTF-8"?>
<addNumCL>
<user>
<username>xxxxxx</username>
<password>xxxxxx</password>
</user>
<cl>
<id>21518</id>
<destinations>
 <destination>
 <phone>?055XXXXXXX</phone>
 <df1>?Israel</df1>
 <df2>?Israeli</df2>
 <df3>?Haifa</df3>
 </destination>
 <destination>
 <phone>55XXXXXXX</phone>
 </destination>
</destinations>
</cl>
<cl>
<id>21500</id>
<destinations>
 <destination>
 <phone>055XXXXXXX</phone>
 </destination>
 <destination>
 <phone>55XXXXXXX</phone>
 </destination>
</destinations>
</cl>
</addNumCL>
                        
                        
Fields:
  • addNumCL- Required element. Contains all other elements
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • cl- Required element. Contains the Details of the contact list that you want to update
  • Id- Required element. Contains Id you want to update.
  • Destinations- Required element. Contains all the numbers have been added to a contact list.
  • Destination- Required element. contains the details for any phone number.
  • Phone - Required element. must be formatted: 5xxxxxxx or 05xxxxxxx
  • df1/ df2/ df3/ df4/ df5/ df6- Optional element. contains a dynamic field for all listed telephone number.
In which the response will be something like :

<?xml version="1.0" encoding="UTF-8"?>
<addNumCL>
<status>?0</status>
<message>? The phone numbers have been added successfully</message>
<errors>
<error>?contact list id: 21500 does not exist and therefore not removed</?error
 <error>?The phone is too long or too short or contain characters and therefore not added</error>
 </errors>
</addNumCL>

                
                
Fields:
  • Error- shows the possible errors in XML.

Remove a number from Contact lists exists

If you want to remove numbers from an existing contact list, send XML similar to the following example:

 
<?xml version="1.0" encoding="UTF-8"?>
<rmNumCL>
<user>
<username>?xxxxxx</username>
<password>?xxxxxx</password>
</user>
<cl>
<id>?21518</id>
<destinations>
<phone>?055XXXXXXX</phone>
</destinations>
</cl>
<cl>
<id>?21500</id>
<destinations>
<phone>?055XXXXXXX</phone>
<phone>?55XXXXXXX</phone>
</destinations>
</cl>
</rmNumCL>
                        
                        
Fields:
  • rmNumCL- Required element. Contains all other elements
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • cl- Required element. Contains the Details of the contact list that you want to update
  • Id- Required element. Contains Id you want to update.
  • Destinations- Required element. Contains all the numbers have been added to a contact list.
  • Destination- Required element. contains the details for any phone number.
  • Phone - Required element. must be formatted: 5xxxxxxx or 05xxxxxxx
In which the response will be something like :

<?xml version="1.0" encoding="UTF-8"?>
<rmNumCL>
<status>?0</status>
<message>?Successfully deleted phone numbers</message>
<errors>
 <error>?contact list id: 21500 does not exist and therefore not removed</?error
 </errors>
</rmNumCL>

                
                
Fields:
  • Error- shows the possible errors in XML.

Get contact lists

If you wish to get the contact lists send an XML similar to the following example:

 
<?xml version="1.0" encoding="UTF-8"?>
<getCL>
<user>
<username> ?xxxxxx? </username>
<password> ?xxxxxx? </password>
</user>
</getCL>

                        
                        
Fields:
  • getCL - Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
In which the response will be something like :

<?xml version="1.0" encoding="UTF-8"?>
<?getCL?>
<status>?0</status>
<message></message>
<contact_lists>
<contact_list>
<cl_id>?21518</cl_id>
<phone>?55XXXXXXX</phone>
<name>?name1</name>
</?contact_list?>
<?contact_list?>
<cl_id>21518</cl_id>
<phone>?555XXXXXX</phone>
<name>?name1</name>
</?contact_list?>
<?contact_list?>
<cl_id>?21500</cl_id>
<phone>?055XXXXXXX</phone>
<name>?name2</name>
</?contact_list?>
</?contact_list?s>
</?getCL?>


                
                

Cancel Campaign

If you wish to get the contact lists send an XML similar to the following example:

 
<?xml version="1.0" encoding="UTF-8"?>
<cancel>
<user>
 <username>Leeroy</username>
<password>Jenkins</password>
</user>
<campaign_id>Jenkins</campaign_id>
</cancel>
                        
                        
Fields:
  • cancel- Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • campaign_id- Required element. The number of the your campaign
In which the response will be something like :

<?xml version="1.0" encoding="UTF-8"?>
<cancel>
 <status>0</status>
<message>Campaign successfuly cancel</message>
</cancel>


                
                

Function for subscribe

Add subscriber

If you wish to add subscriber an XML similar to the following example:


<?xml version="1.0" encoding="UTF-8"?>
<addSub>
<user>
<username>xxxxxx </username>
<password> xxxxxx </password>
</user>
<userDetails>
<name>israel israeli</name>
<username> israelisraeli </username>
<password> israelisraeli </password>
<source>055xxxxxxx</source>
<amount>70000</amount>
</userDetails>
</addSub>
                   
                   
Fields:
  • addSub - Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • userDetails- Required element. Contains the Details of the user that you want to start.
  • Name - Required element. Contains the name you want to give the user
  • Username- Required element. Contains the username you want to give the user.
  • Password- Required element. Contains the password you want to give the user.
  • Source- Required element. Contains the source you want to give the user. Default.
  • Amount - Required element. Contains the amount of credits you want to give the user. Contain only digits
In which the response will look something like:

<?xml version="1.0" encoding="UTF-8"?>
<addSub>
<status>0</status>
<message> The user was created successfully</message>
</addSub>
                
                

Update wallet of subscribers

If you wish to update the wallet of subscribers an XML similar to the following example:


    <?xml version="1.0" encoding="UTF-8"?>
<updateAmountSub>
<user>
<username>xxxxxx</username>
<password>xxxxxx</password>
</user>
<userDetails>
<username>username1</username>
<password>password1</password>
<amount>70000</amount>
</userDetails>
</updateAmountSub>
                
                
Fields:
  • updateAmountSub- Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • userDetails- Required element. Contains the Details of the user that you want to update.
  • Username- Required element. Contains the username you want to update subscriber.
  • Password- Required element. Contains the password you want to update subscriber.
  • amount - Required element. Contains the amount of credits you want to give the user. Contain only digits.
In which the response will look something like:

<?xml version="1.0" encoding="UTF-8"?>
<updateAmountSub>
<status>0</status>
<message>Wallet successfully updated</message>
</updateAmountSub>
                
                

Get the balance of all subscribers

If you wish to get the balance of all subscribers an XML similar to the following example:


<?xml version="1.0" encoding="UTF-8"?>
<getBlanceSubs>
<user>
<username> xxxxxx </username>
<password> xxxxxx </password>
</user>
</getBlanceSubs>
                
                
Fields:
  • getBlanceSubs - Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
In which the response will look something like:

    <?xml version="1.0" encoding="UTF-8"?>
<getBlanceSubs>
<status>0</status>
<message></message>
<balances>
<balance>
<amount>80</amount>
<sms_user_id>xxx</sms_user_id>
<name>name1</name>
</balance>
<balance>
<amount>50</amount>
<sms_user_id>xxx</sms_user_id>
<name> name2</name >
</balance>
</balances>
</getBlanceSubs>
                
                

Function for contact lists

Create a contact list

If you wish to create contact list an XML similar to the following example:


    <?xml version="1.0" encoding="UTF-8"?>
<newCL>
<user>
<username> xxxxxx </username>
<password> xxxxxx </password>
</user>
<cl>
<name>name1</name>
<destinations>
</destinations>
</cl>
<cl>
<name>name2</name>
<destinations>
</destinations>
</cl>
</newCL>
                
                
Fields:
  • newCL - Required element. Contains all other elements.
  • user - Required element. Contains all user elements
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • cl- Required element. Contains the Details of the contact list that you want to start.
  • Destinations- Required element. Contains all the numbers have been added to a contact list.
  • Destination- Required element. contains the details for any phone number.
  • Phone - Required element. must be formatted: 5xxxxxxx or 05xxxxxxx.
  • df1/ df2/ df3/ df4/ df5/ df6- Optional element. contains a dynamic field for all listed telephone number.
In which the response will look something like:

    <?xml version="1.0" encoding="UTF-8"?>
<newCL>
<status>0</status>
<message>conact list successfully created</message>
<errors>
<error>The phone is too long or too short or contain characters and therefore not added</error>
</errors>
<identifiers>
<identifier>17419</identifier>
</identifiers>
</newCL>
                
                
Fields:
  • Error- shows the possible errors in XML.
  • Identifier-returns the ID of the contact lists created.

Remove a contact list

If you wish to remove a contact lists send an XML similar to the following example:


    <?xml version="1.0" encoding="UTF-8"?>
<removeCL>
<user>
<username>xxxxxx</username>
<password>xxxxxx</password>
</user>
<cl>
<id>21518</id>
<id>21500</id>
</cl>
</removeCL>
                
                
Fields:
  • removeCL - Required element. Contains all other elements.
  • user - Required element. Contains all user elements.
  • username - Required element. The username of the account by which you are recognized in the system.
  • password - Required element. The password to your user account.
  • cl- Required element. Contains identifiers you want to remove.
  • Id- Required element. Contains an id of contact list you want to remove.
In which the response will look something like:

    <?xml version="1.0" encoding="UTF-8"?>
<removeCL>
<status>0</status>
<message>contact list successfully removed</message>
<errors>
<error>contact list id: 21500 does not exist and therefore not removed</error>
</errors>
</removeCL>
                
                
Fields:
  • error- shows the possible errors in XML.

code-example

PHP example

Send SMS PHP example


<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://my.textme.co.il/api",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "<?xml version='1.0' encoding='UTF-8'?>
                        \r\n <sms>\r\n <user>\r\n <username>my_username</username>
                        \r\n <password>my_password</password>\r\n </user>\r\n <source>sender</source>
                        \r\n <destinations>\r\n <phone id='someid1'>0500123456</phone>
                        \r\n </destinations>\r\n <message>test</message>\r\n </sms>",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache",
    "Content-Type: application/xml"

  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

                    

Get Incoming SMS PHP example

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://my.textme.co.il/api",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<incoming>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<from>01/01/18 00:00</from>\r\n<to>01/01/18 23:59</to>\r\n</incoming>\r\n                        ",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache",
    "Content-Type: application/xml"
	),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

                    



<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://my.textme.co.il/api",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<newCL>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<cl>\r\n<name>name1</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n<cl>\r\n<name>name2</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n</newCL>\r\n                ",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache",
    "Content-Type: application/xml"

  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
                    


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://my.textme.co.il/api",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<balance>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n</balance>",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache",
    "Content-Type: application/xml"

  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

                    

code-example

C# example

Send SMS c# example



var client = new RestClient("https://my.textme.co.il/api");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Content-Type", "application/xml");
request.AddParameter("undefined", "<?xml version='1.0' encoding='UTF-8'?>\r\n        <sms>\r\n        <user>\r\n        <username>username</username>\r\n        <password>password</password>\r\n        </user>\r\n        <source>sender</source>\r\n        <destinations>\r\n        <phone id='someid1'>0500123456</phone>\r\n        </destinations>\r\n        <message>test message</message>\r\n        </sms>", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

                    

Get Incoming SMS c# example

var client = new RestClient("https://my.textme.co.il/api");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Content-Type", "application/xml");
request.AddParameter("undefined", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<incoming>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<from>01/01/18 00:00</from>\r\n<to>01/01/18 23:59</to>\r\n</incoming>\r\n                        ", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

                    

Create_contact_lis c# example



var client = new RestClient("https://my.textme.co.il/api");
var request = new RestRequest(Method.POST);
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Content-Type", "application/xml");
request.AddParameter("undefined", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<newCL>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<cl>\r\n<name>name1</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n<cl>\r\n<name>name2</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n</newCL>\r\n                ", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                    

Get balance c# example


var client = new RestClient("https://my.textme.co.il/api");
var request = new RestRequest(Method.POST);
request.AddHeader("Postman-Token", "8707d2e3-6a67-4ddf-b9c0-44118adb1e7b");
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Content-Type", "application/xml");
request.AddParameter("undefined", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<balance>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n</balance>", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

                    

code-example

java example

Send SMS java example


HttpResponse<String>  response = Unirest.post("https://my.textme.co.il/api")
  .header("Content-Type", "application/xml")
  .header("Cache-Control", "no-cache")
  .body("<?xml version='1.0' encoding='UTF-8'?> \r\n        <sms> \r\n        <user> \r\n        <username> username</username> \r\n        <password> powwow</password> \r\n        </user> \r\n        <source> sender</source> \r\n        <destinations> \r\n        <phone id='someid1'> 0500123456</phone> \r\n        </destinations> \r\n        <message> test message</message> \r\n        </sms> ")
  .asString();

                    

Get Incoming SMS java example

HttpResponse<String> response = Unirest.post("https://my.textme.co.il/api")
  .header("Content-Type", "application/xml")
  .header("Cache-Control", "no-cache")
  .body("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<incoming>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<from>01/01/18 00:00</from>\r\n<to>01/01/18 23:59</to>\r\n</incoming>\r\n                        ")
  .asString();

                    

Create_contact_lis java example


HttpResponse<String> response = Unirest.post("https://my.textme.co.il/api")
  .header("Content-Type", "application/xml")
  .header("Cache-Control", "no-cache")
  .body("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<newCL>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<cl>\r\n<name>name1</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n<cl>\r\n<name>name2</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n</newCL>\r\n                ")
  .asString();
                    

Get balance java example



HttpResponse<String> response = Unirest.post("https://my.textme.co.il/api")
  .header("Content-Type", "application/xml")
  .header("Cache-Control", "no-cache")
  .body("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<balance>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n</balance>")
  .asString();


                    

code-example

python example

Send SMS python example


import http.client

conn = http.client.HTTPConnection("my,textme,co,il")

payload = "<?xml version='1.0' encoding='UTF-8'?<\r\n        <sms<\r\n        <user<\r\n        <username<username</username<\r\n        <password<password</password<\r\n        </user<\r\n        <source<sender</source<\r\n        <destinations<\r\n        <phone id='someid1'<0500123456</phone<\r\n        </destinations<\r\n        <message<test message</message<\r\n        </sms<"

headers = {
    'Content-Type': "application/xml",
    'Cache-Control': "no-cache",
    'Postman-Token': "099868bb-1f3b-4bb8-917b-dac4da12711a"
    }

conn.request("POST", "api", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

                    

Get Incoming SMS python example

import http.client

conn = http.client.HTTPConnection("my,textme,co,il")

payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<incoming>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<from>01/01/18 00:00</from>\r\n<to>01/01/18 23:59</to>\r\n</incoming>\r\n                        "

headers = {
    'Content-Type': "application/xml",
    'Cache-Control': "no-cache"
      }

conn.request("POST", "api", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

                    

Create_contact_lis python example


import http.client

conn = http.client.HTTPConnection("my,textme,co,il")

payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<newCL>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<cl>\r\n<name>name1</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n<cl>\r\n<name>name2</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n</newCL>\r\n                "

headers = {
    'Content-Type': "application/xml",
    'Cache-Control': "no-cache"
    }

conn.request("POST", "api", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
                    

Get balance python example


import http.client

conn = http.client.HTTPConnection("my,textme,co,il")

payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<balance>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n</balance>"

headers = {
    'Content-Type': "application/xml",
    'Cache-Control': "no-cache"
    }

conn.request("POST", "api", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

                    

code-example

nodejs example

Send SMS nodejs example


var request = require("request");

var options = { method: 'POST',
  url: 'https://my.textme.co.il/api',
  headers:
   {'Cache-Control': 'no-cache',
     'Content-Type': 'application/xml' },
  body: '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\r\n        <sms>\r\n        <user>\r\n        <username>powwow</username>\r\n        <password>powwow</password>\r\n        </user>\r\n        <source>test</source>\r\n        <destinations>\r\n        <phone id=\'someid1\'>0544610582</phone>\r\n        </destinations>\r\n        <message>test</message>\r\n        </sms>' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

                    

Get Incoming SMS nodejs example

var request = require("request");

var options = { method: 'POST',
  url: 'https://my.textme.co.il/api',
  headers:
   {
     'Cache-Control': 'no-cache',
     'Content-Type': 'application/xml' },
  body: '<?xml version="1.0" encoding="UTF-8"?>\r\n<incoming>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<from>01/01/18 00:00</from>\r\n<to>01/01/18 23:59</to>\r\n</incoming>\r\n                        ' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

                    

Create_contact_lis nodejs example


var request = require("request");

var options = { method: 'POST',
  url: 'https://my.textme.co.il/api',
  headers:
   { 'Cache-Control': 'no-cache',
     'Content-Type': 'application/xml' },
  body: '<?xml version="1.0" encoding="UTF-8"?>\r\n<newCL>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<cl>\r\n<name>name1</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n<cl>\r\n<name>name2</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n</newCL>\r\n                ' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
                    

Get balance nodejs example


var request = require("request");

var options = { method: 'POST',
  url: 'https://my.textme.co.il/api',
  headers:
   { 'Cache-Control': 'no-cache',
     'Content-Type': 'application/xml' },
  body: '<?xml version="1.0" encoding="UTF-8"?>\r\n<balance>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n</balance>' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});


                    

code-example

ruby example

Send SMS ruby example


require 'uri'
require 'net/http'

url = URI("https://my.textme.co.il/api")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/xml'
request["Cache-Control"] = 'no-cache'
request.body = "< ?xml version='1.0' encoding='UTF-8'?> \r\n        < sms> \r\n        < user> \r\n        < username> username< /username> \r\n        < password> password< /password> \r\n        < /user> \r\n        < source> sender< /source> \r\n        < destinations> \r\n        < phone id='someid1'> 0500123456< /phone> \r\n        < /destinations> \r\n        < message> test message< /message> \r\n        < /sms> "

response = http.request(request)
puts response.read_body

                    

Get Incoming SMS ruby example

require 'uri'
require 'net/http'

url = URI("https://my.textme.co.il/api")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/xml'
request["Cache-Control"] = 'no-cache'
request.body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<incoming>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<from>01/01/18 00:00</from>\r\n<to>01/01/18 23:59</to>\r\n</incoming>\r\n                        "

response = http.request(request)
puts response.read_body

                    

Create_contact_lis ruby example


require 'uri'
require 'net/http'

url = URI("https://my.textme.co.il/api")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/xml'
request["Cache-Control"] = 'no-cache'
request.body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<newCL>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n<cl>\r\n<name>name1</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n<cl>\r\n<name>name2</name>\r\n<destinations>\r\n</destinations>\r\n</cl>\r\n</newCL>\r\n                "

response = http.request(request)
puts response.read_body
                    

Get balance ruby example


require 'uri'
require 'net/http'

url = URI("https://my.textme.co.il/api")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/xml'
request["Cache-Control"] = 'no-cache'
request.body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<balance>\r\n<user>\r\n<username>username</username>\r\n<password>password</password>\r\n</user>\r\n</balance>"

response = http.request(request)
puts response.read_body