<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://docs.upsidewireless.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://docs.upsidewireless.com/index.php?feed=atom&amp;namespace=0&amp;title=Special%3ANewPages</id>
		<title>SMS Wiki - New pages [en]</title>
		<link rel="self" type="application/atom+xml" href="http://docs.upsidewireless.com/index.php?feed=atom&amp;namespace=0&amp;title=Special%3ANewPages"/>
		<link rel="alternate" type="text/html" href="http://docs.upsidewireless.com/index.php?title=Special:NewPages"/>
		<updated>2026-04-09T04:30:36Z</updated>
		<subtitle>From SMS Wiki</subtitle>
		<generator>MediaWiki 1.22.0</generator>

	<entry>
		<id>http://docs.upsidewireless.com/index.php?title=CSharp_JSON_Example</id>
		<title>CSharp JSON Example</title>
		<link rel="alternate" type="text/html" href="http://docs.upsidewireless.com/index.php?title=CSharp_JSON_Example"/>
				<updated>2018-02-10T00:01:39Z</updated>
		
		<summary type="html">&lt;p&gt;Bzurkovic: Created page with &amp;quot;Below is sample code for C#. You are welcome to cut+paste this sample into your application, however, keep in mind that depending on your environment, some changes may be requ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is sample code for C#. You are welcome to cut+paste this sample into your application, however, keep in mind that depending on your environment, some changes may be required. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:  In order to run this sample, you need to reference System.Web.Extensions&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Web.Script.Serialization;&lt;br /&gt;
using System.Xml;&lt;br /&gt;
using System.Xml.Serialization;&lt;br /&gt;
&lt;br /&gt;
namespace TestUpsideRESTAPIJSON&lt;br /&gt;
{&lt;br /&gt;
    class Program&lt;br /&gt;
    {&lt;br /&gt;
        const string APIEndPoint = &amp;quot;https://secureapi.upsidewireless.com&amp;quot;; // or &amp;quot;http://api.upsidewireless.com&amp;quot;&lt;br /&gt;
        const string APICredential_Token = &amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;;&lt;br /&gt;
        const string APICredential_Signature = &amp;quot;xxxxxxxxfyqQx95Gxxxxxxxx&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        private static readonly string SMSMessageUrl = string.Format(&amp;quot;{0}/RESTv1/{1}/Message&amp;quot;, APIEndPoint, APICredential_Token);&lt;br /&gt;
&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
            bool acceptJSON = false;&lt;br /&gt;
&lt;br /&gt;
            Console.WriteLine(&amp;quot;SMS Message URL: &amp;quot; + SMSMessageUrl + &amp;quot;\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            var request = WebRequest.Create(SMSMessageUrl) as HttpWebRequest;&lt;br /&gt;
            request.Method = &amp;quot;POST&amp;quot;;&lt;br /&gt;
            request.ContentType = &amp;quot;application/json&amp;quot;;&lt;br /&gt;
            request.Accept = acceptJSON ? &amp;quot;application/json&amp;quot; : &amp;quot;application/xml&amp;quot;;&lt;br /&gt;
            request.UserAgent = &amp;quot;UpsideCSharpAgent&amp;quot;;&lt;br /&gt;
            // use default timeout&lt;br /&gt;
            //request.Timeout = 100 * 1000; // in miliseconds&lt;br /&gt;
            //request.ReadWriteTimeout = 300 * 1000; // in miliseconds&lt;br /&gt;
&lt;br /&gt;
            string type = &amp;quot;sms&amp;quot;; // see type list on wiki&lt;br /&gt;
            string message = &amp;quot;test sms message&amp;quot;;&lt;br /&gt;
            string recipient = &amp;quot;16047891236&amp;quot;; // number in E.164 format&lt;br /&gt;
            string encoding = &amp;quot;7&amp;quot;; // 7, 8 or 16&lt;br /&gt;
&lt;br /&gt;
            var jsonObject = &amp;quot;{signature:\&amp;quot;&amp;quot; + APICredential_Signature + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,type:\&amp;quot;&amp;quot; + type + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,message:\&amp;quot;&amp;quot; + message + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,recipient:\&amp;quot;&amp;quot; + recipient + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,encoding:\&amp;quot;&amp;quot; + encoding + &amp;quot;\&amp;quot;}&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
            Console.WriteLine(&amp;quot;Post Data: &amp;quot; + jsonObject + &amp;quot;\n&amp;quot;);&lt;br /&gt;
            var data = Encoding.UTF8.GetBytes(jsonObject);&lt;br /&gt;
            request.ContentLength = data.Length;&lt;br /&gt;
&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                using (var stream = request.GetRequestStream())&lt;br /&gt;
                {&lt;br /&gt;
                    stream.Write(data, 0, data.Length);&lt;br /&gt;
&lt;br /&gt;
                    HttpWebResponse response;&lt;br /&gt;
                    try&lt;br /&gt;
                    {&lt;br /&gt;
                        response = request.GetResponse() as HttpWebResponse;&lt;br /&gt;
                    }&lt;br /&gt;
                    catch (WebException ex)&lt;br /&gt;
                    {&lt;br /&gt;
                        response = ex.Response as HttpWebResponse;&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
                    var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();&lt;br /&gt;
&lt;br /&gt;
                    Console.WriteLine(&amp;quot;HTTP Response: &amp;quot; + responseString + &amp;quot;\n&amp;quot;);&lt;br /&gt;
                    RestResponse restResponse = null;&lt;br /&gt;
                    if (acceptJSON)&lt;br /&gt;
                    {&lt;br /&gt;
                        JavaScriptSerializer JSS = new JavaScriptSerializer();&lt;br /&gt;
                        restResponse = JSS.Deserialize&amp;lt;RestResponse&amp;gt;(responseString);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        var sreader = new StringReader(responseString);&lt;br /&gt;
                        var xmlreader = new XmlTextReader(sreader);&lt;br /&gt;
                        XmlSerializer serializer = new XmlSerializer(typeof(RestResponse));&lt;br /&gt;
                        restResponse = serializer.Deserialize(xmlreader) as RestResponse;&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
                    if (restResponse != null)&lt;br /&gt;
                    {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Rest Response - HasException: &amp;quot; + restResponse.HasException);&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Rest Response - Token: &amp;quot; + restResponse.Token);&lt;br /&gt;
                        if (restResponse.HasException)&lt;br /&gt;
                        {&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - RestException.ErrorCode: &amp;quot; + restResponse.RestException.ErrorCode);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - RestException.Message: &amp;quot; + restResponse.RestException.Message);&lt;br /&gt;
                            if (restResponse.RestException.Status != null)&lt;br /&gt;
                                Console.WriteLine(&amp;quot;Rest Response - RestException.Status: &amp;quot; + restResponse.RestException.Status);&lt;br /&gt;
                        }&lt;br /&gt;
                        else&lt;br /&gt;
                        {&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Status: &amp;quot; + restResponse.SMSMessage.Status);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Recipient: &amp;quot; + restResponse.SMSMessage.Recipient);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Body: &amp;quot; + restResponse.SMSMessage.Body);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Type: &amp;quot; + restResponse.SMSMessage.Type);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.TrackingId: &amp;quot; + restResponse.SMSMessage.TrackingId);&lt;br /&gt;
                            if (restResponse.SMSMessage.Status == &amp;quot;REJECTED&amp;quot;)&lt;br /&gt;
                                Console.WriteLine(&amp;quot;Rest Response - SMSMessage.RejectReason: &amp;quot; + restResponse.SMSMessage.RejectReason);&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Can't get rest response object&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            catch (Exception e)&lt;br /&gt;
            {&lt;br /&gt;
                Console.WriteLine(&amp;quot;Error in calling REST API - &amp;quot; + e.Message);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            Console.ReadKey();&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public class RestResponse&lt;br /&gt;
    {&lt;br /&gt;
        public bool HasException { get; set; }&lt;br /&gt;
        public string Token { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public SMSMessage SMSMessage { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public RestException RestException { get; set; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public class SMSMessage&lt;br /&gt;
    {&lt;br /&gt;
        public string Status { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public string Recipient { get; set; }&lt;br /&gt;
        public string Body { get; set; }&lt;br /&gt;
        public string Type { get; set; }&lt;br /&gt;
        public string TrackingId { get; set; }&lt;br /&gt;
        public string RejectReason { get; set; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public class RestException&lt;br /&gt;
    {&lt;br /&gt;
        public int ErrorCode { get; set; }&lt;br /&gt;
        public string Message { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public string Status { get; set; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Bzurkovic</name></author>	</entry>

	<entry>
		<id>http://docs.upsidewireless.com/index.php?title=Java_JSON_Example</id>
		<title>Java JSON Example</title>
		<link rel="alternate" type="text/html" href="http://docs.upsidewireless.com/index.php?title=Java_JSON_Example"/>
				<updated>2018-02-09T23:57:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bzurkovic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is sample code for Java programmers. You are welcome to cut+paste this sample into your application, however, keep in mind that depending on your environment, some changes may be required. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: In order to run this sample, you need include MOXy library, as well as JAXB if no built-in JAXB in your JDK&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.InputStream;&lt;br /&gt;
import java.io.InputStreamReader;&lt;br /&gt;
import java.io.PrintWriter;&lt;br /&gt;
import java.io.StringReader;&lt;br /&gt;
import java.net.HttpURLConnection;&lt;br /&gt;
import java.net.URL;&lt;br /&gt;
import java.net.URLEncoder;&lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
&lt;br /&gt;
import javax.xml.bind.JAXBContext;&lt;br /&gt;
import javax.xml.bind.Unmarshaller;&lt;br /&gt;
import javax.xml.bind.annotation.XmlAccessType;&lt;br /&gt;
import javax.xml.bind.annotation.XmlAccessorType;&lt;br /&gt;
import javax.xml.bind.annotation.XmlElement;&lt;br /&gt;
import javax.xml.bind.annotation.XmlRootElement;&lt;br /&gt;
import javax.xml.transform.stream.StreamSource;&lt;br /&gt;
&lt;br /&gt;
import org.eclipse.persistence.jaxb.JAXBContextProperties;&lt;br /&gt;
import org.eclipse.persistence.jaxb.xmlmodel.ObjectFactory;&lt;br /&gt;
&lt;br /&gt;
public class TestUpsideRESTAPIJSON {&lt;br /&gt;
	&lt;br /&gt;
	public static final String APIEndPoint = &amp;quot;https://secureapi.upsidewireless.com&amp;quot;; // or &amp;quot;http://api.upsidewireless.com&amp;quot;&lt;br /&gt;
	public static final String APICredential_Token =&amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;;&lt;br /&gt;
	public static final String APICredential_Signature = &amp;quot;xxxxxxxxfyqQx95Gxxxxxxxx&amp;quot;;&lt;br /&gt;
	&lt;br /&gt;
	private static String SMSMsgUrl = String.format(&amp;quot;%s/RESTv1/%s/Message&amp;quot;, APIEndPoint, APICredential_Token);&lt;br /&gt;
&lt;br /&gt;
	public static void main(String[] argv) throws Exception {&lt;br /&gt;
		HttpURLConnection connection = null;&lt;br /&gt;
        boolean acceptJSON = true;&lt;br /&gt;
        &lt;br /&gt;
        System.out.println(&amp;quot;SMS Message URL: &amp;quot; + SMSMsgUrl);&lt;br /&gt;
        &lt;br /&gt;
        try {&lt;br /&gt;
            URL smsMessageUrl = new URL(SMSMsgUrl);&lt;br /&gt;
            connection = (HttpURLConnection)smsMessageUrl.openConnection();&lt;br /&gt;
&lt;br /&gt;
    		connection.setRequestMethod(&amp;quot;POST&amp;quot;);&lt;br /&gt;
    		connection.setRequestProperty(&amp;quot;Content-Type&amp;quot;, &amp;quot;application/json&amp;quot;);&lt;br /&gt;
    		connection.setRequestProperty(&amp;quot;Accept&amp;quot;, acceptJSON ? &amp;quot;application/json&amp;quot; : &amp;quot;application/xml&amp;quot;);&lt;br /&gt;
    		connection.setRequestProperty(&amp;quot;User-Agent&amp;quot;, &amp;quot;UpsideJavaAgent&amp;quot;);&lt;br /&gt;
    		connection.setConnectTimeout(100 * 1000); // 100 seconds&lt;br /&gt;
    		connection.setReadTimeout(300 * 1000); // 300 seconds&lt;br /&gt;
    		connection.setDoOutput(true);&lt;br /&gt;
    		&lt;br /&gt;
            String type = &amp;quot;sms&amp;quot;; // see type list on wiki&lt;br /&gt;
            String message = &amp;quot;test sms message&amp;quot;;&lt;br /&gt;
            String recipient = &amp;quot;16047891236&amp;quot;; // number in E.164 format&lt;br /&gt;
            String encoding = &amp;quot;7&amp;quot;; // 7, 8 or 16&lt;br /&gt;
            &lt;br /&gt;
            String jsonObject = &amp;quot;{signature:\&amp;quot;&amp;quot; + APICredential_Signature + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,type:\&amp;quot;&amp;quot; + type + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,message:\&amp;quot;&amp;quot; + message + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,recipient:\&amp;quot;&amp;quot; + recipient + &amp;quot;\&amp;quot;&amp;quot;;&lt;br /&gt;
            jsonObject += &amp;quot;,encoding:\&amp;quot;&amp;quot; + encoding + &amp;quot;\&amp;quot;}&amp;quot;;&lt;br /&gt;
            &lt;br /&gt;
    		PrintWriter pw = new PrintWriter(connection.getOutputStream());&lt;br /&gt;
    		pw.println(jsonObject);&lt;br /&gt;
    		pw.close();&lt;br /&gt;
&lt;br /&gt;
			InputStream input = null;&lt;br /&gt;
			try {&lt;br /&gt;
				input = connection.getInputStream();&lt;br /&gt;
			} catch (Exception e) {&lt;br /&gt;
				input = connection.getErrorStream();&lt;br /&gt;
			}&lt;br /&gt;
			StringBuffer sbResponse = new StringBuffer(1024);&lt;br /&gt;
			BufferedReader reader = new BufferedReader(new InputStreamReader(input));&lt;br /&gt;
			String inputLine = null;&lt;br /&gt;
			while ((inputLine = reader.readLine()) != null) {&lt;br /&gt;
				sbResponse.append(inputLine);&lt;br /&gt;
			}&lt;br /&gt;
			reader.close();&lt;br /&gt;
			&lt;br /&gt;
			String responseString = sbResponse.toString();&lt;br /&gt;
			System.out.println(&amp;quot;REST Response: &amp;quot; + responseString);&lt;br /&gt;
			&lt;br /&gt;
			RestResponse restResponse = null;&lt;br /&gt;
			if (acceptJSON) {&lt;br /&gt;
		        Map&amp;lt;String, Object&amp;gt; properties = new HashMap&amp;lt;String, Object&amp;gt;(2);&lt;br /&gt;
		        properties.put(JAXBContextProperties.MEDIA_TYPE, &amp;quot;application/json&amp;quot;);&lt;br /&gt;
		        properties.put(JAXBContextProperties.JSON_INCLUDE_ROOT, false);&lt;br /&gt;
		        JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] {RestResponse.class, ObjectFactory.class}, properties);&lt;br /&gt;
		        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();&lt;br /&gt;
		        StringReader sr = new StringReader(responseString);&lt;br /&gt;
		        StreamSource json = new StreamSource(sr);&lt;br /&gt;
		        restResponse = unmarshaller.unmarshal(json, RestResponse.class).getValue();&lt;br /&gt;
				&lt;br /&gt;
				// or use your favourite method to parse JSON object&lt;br /&gt;
			} else {&lt;br /&gt;
		        JAXBContext jaxbContext = JAXBContext.newInstance(RestResponse.class);&lt;br /&gt;
		        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();&lt;br /&gt;
		        StringReader sr = new StringReader(responseString);&lt;br /&gt;
		        restResponse = (RestResponse) unmarshaller.unmarshal(sr);&lt;br /&gt;
		        &lt;br /&gt;
				// or use your favourite method to parse XML object&lt;br /&gt;
			}&lt;br /&gt;
    		&lt;br /&gt;
            if (restResponse != null)&lt;br /&gt;
            {&lt;br /&gt;
            	System.out.println(&amp;quot;Rest Response - HasException: &amp;quot; + restResponse.isHasException());&lt;br /&gt;
            	System.out.println(&amp;quot;Rest Response - Token: &amp;quot; + restResponse.getToken());&lt;br /&gt;
                if (restResponse.isHasException())&lt;br /&gt;
                {&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - RestException.ErrorCode: &amp;quot; + restResponse.getRestException().getErrorCode());&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - RestException.Message: &amp;quot; + restResponse.getRestException().getMessage());&lt;br /&gt;
                    if (restResponse.getRestException().getStatus() != null)&lt;br /&gt;
                    	System.out.println(&amp;quot;Rest Response - RestException.Status: &amp;quot; + restResponse.getRestException().getStatus());&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - SMSMessage.Status: &amp;quot; + restResponse.getSMSMessage().getStatus());&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - SMSMessage.Recipient: &amp;quot; + restResponse.getSMSMessage().getRecipient());&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - SMSMessage.Body: &amp;quot; + restResponse.getSMSMessage().getBody());&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - SMSMessage.Type: &amp;quot; + restResponse.getSMSMessage().getType());&lt;br /&gt;
                	System.out.println(&amp;quot;Rest Response - SMSMessage.TrackingId: &amp;quot; + restResponse.getSMSMessage().getTrackingId());&lt;br /&gt;
                    if (&amp;quot;REJECTED&amp;quot;.equals(restResponse.getSMSMessage().getStatus()))&lt;br /&gt;
                    	System.out.println(&amp;quot;Rest Response - SMSMessage.RejectReason: &amp;quot; + restResponse.getSMSMessage().getRejectReason());&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
            	System.out.println(&amp;quot;Can't get rest response object&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
			&lt;br /&gt;
        } catch (Exception e) {&lt;br /&gt;
        	System.out.println(&amp;quot;Error in calling API - &amp;quot; + e.getMessage());&lt;br /&gt;
        	e.printStackTrace();&lt;br /&gt;
        } finally {&lt;br /&gt;
			if (connection != null) {&lt;br /&gt;
				connection.disconnect();&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@XmlRootElement(name=&amp;quot;RestResponse&amp;quot;)&lt;br /&gt;
@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
class RestResponse&lt;br /&gt;
{&lt;br /&gt;
	@XmlElement(name = &amp;quot;HasException&amp;quot;)&lt;br /&gt;
    private boolean HasException;&lt;br /&gt;
	@XmlElement(name = &amp;quot;Token&amp;quot;)&lt;br /&gt;
    private String Token;&lt;br /&gt;
&lt;br /&gt;
	@XmlElement(name = &amp;quot;SMSMessage&amp;quot;)&lt;br /&gt;
    private SMSMessage SMSMessage;&lt;br /&gt;
	@XmlElement(name = &amp;quot;RestException&amp;quot;)&lt;br /&gt;
    private RestException RestException;&lt;br /&gt;
    &lt;br /&gt;
	public boolean isHasException() {&lt;br /&gt;
		return HasException;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public void setHasException(boolean hasException) {&lt;br /&gt;
		HasException = hasException;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getToken() {&lt;br /&gt;
		return Token;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setToken(String token) {&lt;br /&gt;
		Token = token;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public SMSMessage getSMSMessage() {&lt;br /&gt;
		return SMSMessage;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setSMSMessage(SMSMessage sMSMessage) {&lt;br /&gt;
		SMSMessage = sMSMessage;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public RestException getRestException() {&lt;br /&gt;
		return RestException;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setRestException(RestException restException) {&lt;br /&gt;
		RestException = restException;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
class SMSMessage&lt;br /&gt;
{&lt;br /&gt;
	@XmlElement(name = &amp;quot;Status&amp;quot;)&lt;br /&gt;
    private String Status;&lt;br /&gt;
	@XmlElement(name = &amp;quot;Recipient&amp;quot;)&lt;br /&gt;
    private String Recipient;&lt;br /&gt;
	@XmlElement(name = &amp;quot;Body&amp;quot;)&lt;br /&gt;
    private String Body;&lt;br /&gt;
	@XmlElement(name = &amp;quot;Type&amp;quot;)&lt;br /&gt;
    private String Type;&lt;br /&gt;
	@XmlElement(name = &amp;quot;TrackingId&amp;quot;)&lt;br /&gt;
    private String TrackingId;&lt;br /&gt;
	@XmlElement(name = &amp;quot;RejectReason&amp;quot;)&lt;br /&gt;
    private String RejectReason;&lt;br /&gt;
    &lt;br /&gt;
	public String getStatus() {&lt;br /&gt;
		return Status;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public void setStatus(String status) {&lt;br /&gt;
		Status = status;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getRecipient() {&lt;br /&gt;
		return Recipient;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setRecipient(String recipient) {&lt;br /&gt;
		Recipient = recipient;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getBody() {&lt;br /&gt;
		return Body;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setBody(String body) {&lt;br /&gt;
		Body = body;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getType() {&lt;br /&gt;
		return Type;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setType(String type) {&lt;br /&gt;
		Type = type;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getTrackingId() {&lt;br /&gt;
		return TrackingId;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setTrackingId(String trackingId) {&lt;br /&gt;
		TrackingId = trackingId;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getRejectReason() {&lt;br /&gt;
		return RejectReason;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setRejectReason(String rejectReason) {&lt;br /&gt;
		RejectReason = rejectReason;&lt;br /&gt;
	}&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
class RestException&lt;br /&gt;
{&lt;br /&gt;
	@XmlElement(name = &amp;quot;ErrorCode&amp;quot;)&lt;br /&gt;
    private int ErrorCode;&lt;br /&gt;
	@XmlElement(name = &amp;quot;Message&amp;quot;)&lt;br /&gt;
    private String Message;&lt;br /&gt;
	@XmlElement(name = &amp;quot;Status&amp;quot;)&lt;br /&gt;
    private String Status;&lt;br /&gt;
    &lt;br /&gt;
	public int getErrorCode() {&lt;br /&gt;
		return ErrorCode;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public void setErrorCode(int errorCode) {&lt;br /&gt;
		ErrorCode = errorCode;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getMessage() {&lt;br /&gt;
		return Message;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setMessage(String message) {&lt;br /&gt;
		Message = message;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public String getStatus() {&lt;br /&gt;
		return Status;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public void setStatus(String status) {&lt;br /&gt;
		Status = status;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Bzurkovic</name></author>	</entry>

	<entry>
		<id>http://docs.upsidewireless.com/index.php?title=CSharp_Example</id>
		<title>CSharp Example</title>
		<link rel="alternate" type="text/html" href="http://docs.upsidewireless.com/index.php?title=CSharp_Example"/>
				<updated>2015-02-04T20:35:53Z</updated>
		
		<summary type="html">&lt;p&gt;Bzurkovic: Created page with &amp;quot;Below is sample code for C#. You are welcome to cut+paste this sample into your application, however, keep in mind that depending on your environment, some changes may be requ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is sample code for C#. You are welcome to cut+paste this sample into your application, however, keep in mind that depending on your environment, some changes may be required. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:  In order to run this sample, you need to reference System.Web.Extensions&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Web.Script.Serialization;&lt;br /&gt;
using System.Xml;&lt;br /&gt;
using System.Xml.Serialization;&lt;br /&gt;
&lt;br /&gt;
namespace TestUpsideRESTAPI&lt;br /&gt;
{&lt;br /&gt;
    class Program&lt;br /&gt;
    {&lt;br /&gt;
        const string APIEndPoint = &amp;quot;https://secureapi.upsidewireless.com&amp;quot;; // or &amp;quot;http://api.upsidewireless.com&amp;quot;&lt;br /&gt;
        const string APICredential_Token = &amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;;&lt;br /&gt;
        const string APICredential_Signature = &amp;quot;xxxxxxxxfyqQx95Gxxxxxxxx&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        private static readonly string SMSMessageUrl = string.Format(&amp;quot;{0}/RESTv1/{1}/Message&amp;quot;, APIEndPoint, APICredential_Token);&lt;br /&gt;
&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
            bool acceptJSON = false;&lt;br /&gt;
&lt;br /&gt;
            Console.WriteLine(&amp;quot;SMS Message URL: &amp;quot; + SMSMessageUrl + &amp;quot;\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            var request = WebRequest.Create(SMSMessageUrl) as HttpWebRequest;&lt;br /&gt;
           request.Method = &amp;quot;POST&amp;quot;;&lt;br /&gt;
            request.ContentType = &amp;quot;application/x-www-form-urlencoded&amp;quot;;&lt;br /&gt;
            request.Accept = acceptJSON ? &amp;quot;application/json&amp;quot; : &amp;quot;application/xml&amp;quot;;&lt;br /&gt;
            request.UserAgent = &amp;quot;UpsideCSharpAgent&amp;quot;;&lt;br /&gt;
            // use default timeout&lt;br /&gt;
            //request.Timeout = 100 * 1000; // in miliseconds&lt;br /&gt;
            //request.ReadWriteTimeout = 300 * 1000; // in miliseconds&lt;br /&gt;
&lt;br /&gt;
            var smsPostData = &amp;quot;signature={0}&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;type={1}&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;message={2}&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;recipient={3}&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;encoding={4}&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
            string type = &amp;quot;sms&amp;quot;; // see type list on wiki&lt;br /&gt;
            string message = &amp;quot;test sms message&amp;quot;;&lt;br /&gt;
            string recipient = &amp;quot;16047891236&amp;quot;; // number in E.164 format&lt;br /&gt;
            string encoding = &amp;quot;7&amp;quot;; // 7, 8 or 16&lt;br /&gt;
&lt;br /&gt;
            smsPostData = string.Format(smsPostData, APICredential_Signature, type, message, recipient, encoding);&lt;br /&gt;
            Console.WriteLine(&amp;quot;Post Data: &amp;quot; + smsPostData + &amp;quot;\n&amp;quot;);&lt;br /&gt;
            var data = Encoding.UTF8.GetBytes(smsPostData);&lt;br /&gt;
            request.ContentLength = data.Length;&lt;br /&gt;
&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                using (var stream = request.GetRequestStream())&lt;br /&gt;
                {&lt;br /&gt;
                    stream.Write(data, 0, data.Length);&lt;br /&gt;
&lt;br /&gt;
                    HttpWebResponse response;&lt;br /&gt;
                    try&lt;br /&gt;
                    {&lt;br /&gt;
                        response = request.GetResponse() as HttpWebResponse;&lt;br /&gt;
                    }&lt;br /&gt;
                    catch (WebException ex)&lt;br /&gt;
                    {&lt;br /&gt;
                        response = ex.Response as HttpWebResponse;&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
                    var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();&lt;br /&gt;
&lt;br /&gt;
                    Console.WriteLine(&amp;quot;HTTP Response: &amp;quot; + responseString + &amp;quot;\n&amp;quot;);&lt;br /&gt;
                    RestResponse restResponse = null;&lt;br /&gt;
                    if (acceptJSON)&lt;br /&gt;
                    {&lt;br /&gt;
                        JavaScriptSerializer JSS = new JavaScriptSerializer();&lt;br /&gt;
                        restResponse = JSS.Deserialize&amp;lt;RestResponse&amp;gt;(responseString);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        var sreader = new StringReader(responseString);&lt;br /&gt;
                        var xmlreader = new XmlTextReader(sreader);&lt;br /&gt;
                        XmlSerializer serializer = new XmlSerializer(typeof(RestResponse));&lt;br /&gt;
                        restResponse = serializer.Deserialize(xmlreader) as RestResponse;&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
                    if (restResponse != null)&lt;br /&gt;
                    {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Rest Response - HasException: &amp;quot; + restResponse.HasException);&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Rest Response - Token: &amp;quot; + restResponse.Token);&lt;br /&gt;
                        if (restResponse.HasException)&lt;br /&gt;
                        {&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - RestException.ErrorCode: &amp;quot; + restResponse.RestException.ErrorCode);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - RestException.Message: &amp;quot; + restResponse.RestException.Message);&lt;br /&gt;
                            if (restResponse.RestException.Status != null)&lt;br /&gt;
                                Console.WriteLine(&amp;quot;Rest Response - RestException.Status: &amp;quot; + restResponse.RestException.Status);&lt;br /&gt;
                        }&lt;br /&gt;
                        else&lt;br /&gt;
                        {&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Status: &amp;quot; + restResponse.SMSMessage.Status);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Recipient: &amp;quot; + restResponse.SMSMessage.Recipient);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Body: &amp;quot; + restResponse.SMSMessage.Body);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.Type: &amp;quot; + restResponse.SMSMessage.Type);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Rest Response - SMSMessage.TrackingId: &amp;quot; + restResponse.SMSMessage.TrackingId);&lt;br /&gt;
                            if (restResponse.SMSMessage.Status == &amp;quot;REJECTED&amp;quot;)&lt;br /&gt;
                                Console.WriteLine(&amp;quot;Rest Response - SMSMessage.RejectReason: &amp;quot; + restResponse.SMSMessage.RejectReason);&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;Can't get rest response object&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            catch (Exception e)&lt;br /&gt;
            {&lt;br /&gt;
                Console.WriteLine(&amp;quot;Error in calling REST API - &amp;quot; + e.Message);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            Console.ReadKey();&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public class RestResponse&lt;br /&gt;
    {&lt;br /&gt;
        public bool HasException { get; set; }&lt;br /&gt;
        public string Token { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public SMSMessage SMSMessage { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public RestException RestException { get; set; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public class SMSMessage&lt;br /&gt;
    {&lt;br /&gt;
        public string Status { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public string Recipient { get; set; }&lt;br /&gt;
        public string Body { get; set; }&lt;br /&gt;
        public string Type { get; set; }&lt;br /&gt;
        public string TrackingId { get; set; }&lt;br /&gt;
        public string RejectReason { get; set; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public class RestException&lt;br /&gt;
    {&lt;br /&gt;
        public int ErrorCode { get; set; }&lt;br /&gt;
        public string Message { get; set; }&lt;br /&gt;
&lt;br /&gt;
        public string Status { get; set; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Bzurkovic</name></author>	</entry>

	<entry>
		<id>http://docs.upsidewireless.com/index.php?title=Java_Example</id>
		<title>Java Example</title>
		<link rel="alternate" type="text/html" href="http://docs.upsidewireless.com/index.php?title=Java_Example"/>
				<updated>2015-02-03T01:01:48Z</updated>
		
		<summary type="html">&lt;p&gt;Bzurkovic: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below is sample code for Java programmers. You are welcome to cut+paste this sample into your application, however, keep in mind that depending on your environment, some changes may be required. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: In order to run this sample, you need include MOXy library, as well as JAXB if no built-in JAXB in your JDK&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.InputStream;&lt;br /&gt;
import java.io.InputStreamReader;&lt;br /&gt;
import java.io.PrintWriter;&lt;br /&gt;
import java.io.StringReader;&lt;br /&gt;
import java.net.HttpURLConnection;&lt;br /&gt;
import java.net.URL;&lt;br /&gt;
import java.net.URLEncoder;&lt;br /&gt;
import java.util.HashMap;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
import javax.xml.bind.JAXBContext;&lt;br /&gt;
import javax.xml.bind.Unmarshaller;&lt;br /&gt;
import javax.xml.bind.annotation.XmlAccessType;&lt;br /&gt;
import javax.xml.bind.annotation.XmlAccessorType;&lt;br /&gt;
import javax.xml.bind.annotation.XmlElement;&lt;br /&gt;
import javax.xml.bind.annotation.XmlRootElement;&lt;br /&gt;
import javax.xml.transform.stream.StreamSource;&lt;br /&gt;
import org.eclipse.persistence.jaxb.JAXBContextProperties;&lt;br /&gt;
import org.eclipse.persistence.jaxb.xmlmodel.ObjectFactory;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class TestUpsideRESTAPI {&lt;br /&gt;
    &lt;br /&gt;
    public static final String APIEndPoint = &amp;quot;https://secureapi.upsidewireless.com&amp;quot;; // or &amp;quot;http://api.upsidewireless.com&amp;quot;&lt;br /&gt;
    public static final String APICredential_Token =&amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;;&lt;br /&gt;
    public static final String APICredential_Signature = &amp;quot;xxxxxxxxfyqQx95Gxxxxxxxx&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    private static String SMSMessageUrl = String.format(&amp;quot;%s/RESTv1/%s/Message&amp;quot;, APIEndPoint, APICredential_Token);&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] argv) throws Exception {&lt;br /&gt;
        HttpURLConnection connection = null;&lt;br /&gt;
        boolean acceptJSON = false;&lt;br /&gt;
        &lt;br /&gt;
        System.out.println(&amp;quot;SMS Message URL: &amp;quot; + SMSMessageUrl + &amp;quot;\n&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        try {&lt;br /&gt;
            URL smsMessageUrl = new URL(SMSMessageUrl);&lt;br /&gt;
            connection = (HttpURLConnection)smsMessageUrl.openConnection();&lt;br /&gt;
&lt;br /&gt;
            connection.setRequestMethod(&amp;quot;POST&amp;quot;);&lt;br /&gt;
            connection.setRequestProperty(&amp;quot;Content-Type&amp;quot;, &amp;quot;application/x-www-form-urlencoded&amp;quot;);&lt;br /&gt;
            connection.setRequestProperty(&amp;quot;Accept&amp;quot;, acceptJSON ? &amp;quot;application/json&amp;quot; : &amp;quot;application/xml&amp;quot;);&lt;br /&gt;
            connection.setRequestProperty(&amp;quot;User-Agent&amp;quot;, &amp;quot;UpsideJavaAgent&amp;quot;);&lt;br /&gt;
            connection.setConnectTimeout(100 * 1000); // 100 seconds&lt;br /&gt;
            connection.setReadTimeout(300 * 1000); // 300 seconds&lt;br /&gt;
            connection.setDoOutput(true);&lt;br /&gt;
            &lt;br /&gt;
            String smsPostData = &amp;quot;signature=%s&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;type=%s&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;message=%s&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;recipient=%s&amp;quot;;&lt;br /&gt;
            smsPostData += &amp;quot;&amp;amp;encoding=%s&amp;quot;;&lt;br /&gt;
            &lt;br /&gt;
            String type = &amp;quot;sms&amp;quot;; // see type list on wiki&lt;br /&gt;
            String message = &amp;quot;test sms message&amp;quot;;&lt;br /&gt;
            String recipient = &amp;quot;16047891236&amp;quot;; // number in E.164 format&lt;br /&gt;
            String encoding = &amp;quot;7&amp;quot;; // 7, 8 or 16&lt;br /&gt;
            &lt;br /&gt;
            message = URLEncoder.encode(message, &amp;quot;UTF-8&amp;quot;);&lt;br /&gt;
            smsPostData = String.format(smsPostData, APICredential_Signature, type, message, recipient, encoding);&lt;br /&gt;
            System.out.println(&amp;quot;Post Data: &amp;quot; + smsPostData + &amp;quot;\n&amp;quot;);&lt;br /&gt;
            &lt;br /&gt;
            PrintWriter pw = new PrintWriter(connection.getOutputStream());&lt;br /&gt;
            pw.println(smsPostData);&lt;br /&gt;
            pw.close();&lt;br /&gt;
&lt;br /&gt;
            InputStream input = null;&lt;br /&gt;
            try {&lt;br /&gt;
                input = connection.getInputStream();&lt;br /&gt;
            } catch (Exception e) {&lt;br /&gt;
                input = connection.getErrorStream();&lt;br /&gt;
            }&lt;br /&gt;
            StringBuffer sbResponse = new StringBuffer(1024);&lt;br /&gt;
            BufferedReader reader = new BufferedReader(new InputStreamReader(input));&lt;br /&gt;
            String inputLine = null;&lt;br /&gt;
            while ((inputLine = reader.readLine()) != null) {&lt;br /&gt;
                sbResponse.append(inputLine);&lt;br /&gt;
            }&lt;br /&gt;
            reader.close();&lt;br /&gt;
            &lt;br /&gt;
            String responseString = sbResponse.toString();&lt;br /&gt;
            System.out.println(&amp;quot;HTTP Response: &amp;quot; + responseString + &amp;quot;\n&amp;quot;);&lt;br /&gt;
            &lt;br /&gt;
            RestResponse restResponse = null;&lt;br /&gt;
            if (acceptJSON) {&lt;br /&gt;
                Map&amp;lt;String, Object&amp;gt; properties = new HashMap&amp;lt;String, Object&amp;gt;(2);&lt;br /&gt;
                properties.put(JAXBContextProperties.MEDIA_TYPE, &amp;quot;application/json&amp;quot;);&lt;br /&gt;
                properties.put(JAXBContextProperties.JSON_INCLUDE_ROOT, false);&lt;br /&gt;
                JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] {RestResponse.class, ObjectFactory.class}, properties);&lt;br /&gt;
                Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();&lt;br /&gt;
                StringReader sr = new StringReader(responseString);&lt;br /&gt;
               StreamSource json = new StreamSource(sr);&lt;br /&gt;
                restResponse = unmarshaller.unmarshal(json, RestResponse.class).getValue();&lt;br /&gt;
                &lt;br /&gt;
                // or use your favourite method to parse JSON object&lt;br /&gt;
            } else {&lt;br /&gt;
                JAXBContext jaxbContext = JAXBContext.newInstance(RestResponse.class);&lt;br /&gt;
                Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();&lt;br /&gt;
                StringReader sr = new StringReader(responseString);&lt;br /&gt;
                restResponse = (RestResponse) unmarshaller.unmarshal(sr);&lt;br /&gt;
                &lt;br /&gt;
                // or use your favourite method to parse XML object&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            if (restResponse != null)&lt;br /&gt;
            {&lt;br /&gt;
                System.out.println(&amp;quot;Rest Response - HasException: &amp;quot; + restResponse.isHasException());&lt;br /&gt;
                System.out.println(&amp;quot;Rest Response - Token: &amp;quot; + restResponse.getToken());&lt;br /&gt;
                if (restResponse.isHasException())&lt;br /&gt;
                {&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - RestException.ErrorCode: &amp;quot; + restResponse.getRestException().getErrorCode());&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - RestException.Message: &amp;quot; + restResponse.getRestException().getMessage());&lt;br /&gt;
                    if (restResponse.getRestException().getStatus() != null)&lt;br /&gt;
                        System.out.println(&amp;quot;Rest Response - RestException.Status: &amp;quot; + restResponse.getRestException().getStatus());&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - SMSMessage.Status: &amp;quot; + restResponse.getSMSMessage().getStatus());&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - SMSMessage.Recipient: &amp;quot; + restResponse.getSMSMessage().getRecipient());&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - SMSMessage.Body: &amp;quot; + restResponse.getSMSMessage().getBody());&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - SMSMessage.Type: &amp;quot; + restResponse.getSMSMessage().getType());&lt;br /&gt;
                    System.out.println(&amp;quot;Rest Response - SMSMessage.TrackingId: &amp;quot; + restResponse.getSMSMessage().getTrackingId());&lt;br /&gt;
                    if (&amp;quot;REJECTED&amp;quot;.equals(restResponse.getSMSMessage().getStatus()))&lt;br /&gt;
                        System.out.println(&amp;quot;Rest Response - SMSMessage.RejectReason: &amp;quot; + restResponse.getSMSMessage().getRejectReason());&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                System.out.println(&amp;quot;Can't get rest response object&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
        } catch (Exception e) {&lt;br /&gt;
            System.out.println(&amp;quot;Error in calling REST API - &amp;quot; + e.getMessage());&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        } finally {&lt;br /&gt;
            if (connection != null) {&lt;br /&gt;
                connection.disconnect();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@XmlRootElement(name=&amp;quot;RestResponse&amp;quot;)&lt;br /&gt;
@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
class RestResponse&lt;br /&gt;
{&lt;br /&gt;
    @XmlElement(name = &amp;quot;HasException&amp;quot;)&lt;br /&gt;
    private boolean HasException;&lt;br /&gt;
    @XmlElement(name = &amp;quot;Token&amp;quot;)&lt;br /&gt;
    private String Token;&lt;br /&gt;
&lt;br /&gt;
    @XmlElement(name = &amp;quot;SMSMessage&amp;quot;)&lt;br /&gt;
    private SMSMessage SMSMessage;&lt;br /&gt;
    @XmlElement(name = &amp;quot;RestException&amp;quot;)&lt;br /&gt;
    private RestException RestException;&lt;br /&gt;
    &lt;br /&gt;
    public boolean isHasException() {&lt;br /&gt;
        return HasException;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void setHasException(boolean hasException) {&lt;br /&gt;
        HasException = hasException;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getToken() {&lt;br /&gt;
        return Token;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setToken(String token) {&lt;br /&gt;
        Token = token;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public SMSMessage getSMSMessage() {&lt;br /&gt;
        return SMSMessage;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setSMSMessage(SMSMessage sMSMessage) {&lt;br /&gt;
        SMSMessage = sMSMessage;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public RestException getRestException() {&lt;br /&gt;
        return RestException;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setRestException(RestException restException) {&lt;br /&gt;
        RestException = restException;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
class SMSMessage&lt;br /&gt;
{&lt;br /&gt;
    @XmlElement(name = &amp;quot;Status&amp;quot;)&lt;br /&gt;
    private String Status;&lt;br /&gt;
    @XmlElement(name = &amp;quot;Recipient&amp;quot;)&lt;br /&gt;
    private String Recipient;&lt;br /&gt;
    @XmlElement(name = &amp;quot;Body&amp;quot;)&lt;br /&gt;
    private String Body;&lt;br /&gt;
    @XmlElement(name = &amp;quot;Type&amp;quot;)&lt;br /&gt;
    private String Type;&lt;br /&gt;
    @XmlElement(name = &amp;quot;TrackingId&amp;quot;)&lt;br /&gt;
    private String TrackingId;&lt;br /&gt;
    @XmlElement(name = &amp;quot;RejectReason&amp;quot;)&lt;br /&gt;
    private String RejectReason;&lt;br /&gt;
    &lt;br /&gt;
    public String getStatus() {&lt;br /&gt;
        return Status;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void setStatus(String status) {&lt;br /&gt;
        Status = status;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getRecipient() {&lt;br /&gt;
        return Recipient;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setRecipient(String recipient) {&lt;br /&gt;
        Recipient = recipient;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getBody() {&lt;br /&gt;
        return Body;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setBody(String body) {&lt;br /&gt;
        Body = body;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getType() {&lt;br /&gt;
        return Type;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setType(String type) {&lt;br /&gt;
        Type = type;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getTrackingId() {&lt;br /&gt;
        return TrackingId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setTrackingId(String trackingId) {&lt;br /&gt;
        TrackingId = trackingId;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getRejectReason() {&lt;br /&gt;
        return RejectReason;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setRejectReason(String rejectReason) {&lt;br /&gt;
        RejectReason = rejectReason;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@XmlAccessorType(XmlAccessType.FIELD)&lt;br /&gt;
class RestException&lt;br /&gt;
{&lt;br /&gt;
    @XmlElement(name = &amp;quot;ErrorCode&amp;quot;)&lt;br /&gt;
    private int ErrorCode;&lt;br /&gt;
    @XmlElement(name = &amp;quot;Message&amp;quot;)&lt;br /&gt;
    private String Message;&lt;br /&gt;
    @XmlElement(name = &amp;quot;Status&amp;quot;)&lt;br /&gt;
    private String Status;&lt;br /&gt;
    &lt;br /&gt;
    public int getErrorCode() {&lt;br /&gt;
        return ErrorCode;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public void setErrorCode(int errorCode) {&lt;br /&gt;
        ErrorCode = errorCode;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getMessage() {&lt;br /&gt;
        return Message;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setMessage(String message) {&lt;br /&gt;
        Message = message;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getStatus() {&lt;br /&gt;
        return Status;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setStatus(String status) {&lt;br /&gt;
        Status = status;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Bzurkovic</name></author>	</entry>

	<entry>
		<id>http://docs.upsidewireless.com/index.php?title=Send_REST</id>
		<title>Send REST</title>
		<link rel="alternate" type="text/html" href="http://docs.upsidewireless.com/index.php?title=Send_REST"/>
				<updated>2015-02-03T00:55:43Z</updated>
		
		<summary type="html">&lt;p&gt;Bzurkovic: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Upsidewireless REST API '''&lt;br /&gt;
&lt;br /&gt;
There are two endpoints of Upsidewireless REST API, [https://secureapi.upsidewireless.com https://secureapi.upsidewireless.com] and [http://api.upsidewireless.com http://api.upsidewireless.com]. If you care about more security than performance, you should use the secure endpoint. However, in this case you will need to install certificate for secure, authenticated communication. We recommend you select the secure option. &lt;br /&gt;
&lt;br /&gt;
In order to use Upsidewireless REST API, you need have an account that has API permissions and get your API credential (token and signature) on your account page. Token is similar to username and signature is similar to password. They are needed in every single call to REST API.&lt;br /&gt;
&lt;br /&gt;
There are two kinds of response of each API call, JSON or XML. You can either use HTTP header (&amp;quot;Accept&amp;quot;) or a special HTTP parameter (&amp;quot;responsetype&amp;quot;) to specify what kind of response you want. If you want using HTTP header, set either &amp;quot;application/json&amp;quot; or &amp;quot;application/xml&amp;quot; in Accept header. If you want using HTTP parameter, set either &amp;quot;JSON&amp;quot; or &amp;quot;XML&amp;quot; to responsetype parameter. If no response type specified, default response will always be in XML format. Use HTTP header is a highly recommended way to do so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. SMS Message API'''&lt;br /&gt;
&lt;br /&gt;
'''API URI: /RESTv1/{token}/Message'''&lt;br /&gt;
&lt;br /&gt;
'''Support method: HTTP POST '''&lt;br /&gt;
&lt;br /&gt;
The following parameters are all '''required''' in your POST to send the message:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|signature||One of the API credential, similar to a password. It can be found in your account page.&lt;br /&gt;
|-&lt;br /&gt;
|type||The message type. Different type requires a different set of additional parameters.&lt;br /&gt;
|-&lt;br /&gt;
|message||The text of the message you want to send. For some types, this message must be pre-encoded&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
According to different type, a different set of additional parameters is required&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_test''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
'''Additional parameter for type: &amp;quot;sms''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
'''Additional parameters for type: &amp;quot;mms''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|mediaUrl||The URL of the media you wish to send out with the message. gif , png and jpeg content is currently supported. The media size limit is 5MB. If you wish to send more than one image in the message, please provide multiple URLs separated by comma in this parameter.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameter for type: &amp;quot;sms_port''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|port||Port number – valid value is &amp;gt; 0 and &amp;lt; 65535, parameter message must be pre-encoded.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_multi''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212. This parameter can include multiple phone numbers, separated by comma. &lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_group''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|groupName||The name of contact group in your account&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_service_group''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|serviceName||The name of your PSMS service&lt;br /&gt;
|-&lt;br /&gt;
|groupName||The contact group name of your PSMS service&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_dedicated''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|carrierCode||The carrier code that recipient phone number belongs to. This parameter is mandatory if dedicated number is a short code.&lt;br /&gt;
|-&lt;br /&gt;
|dedicatedNumber||The dedicated number which will deliver the message. It could be a long code or a short code.&lt;br /&gt;
|-&lt;br /&gt;
|tariff||The amount that recipient number to be charged&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_dedicated_port''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|port||Port number – valid value is &amp;gt; 0 and &amp;lt; 65535, parameter message must be pre-encoded.&lt;br /&gt;
|-&lt;br /&gt;
|carrierCode||The carrier code that recipient phone number belongs to. This parameter is mandatory if dedicated number is a short code.&lt;br /&gt;
|-&lt;br /&gt;
|dedicatedNumber||The dedicated number which will deliver the message. It could be a long code or a short code.&lt;br /&gt;
|-&lt;br /&gt;
|tariff||The amount that recipient number to be charged&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_defer''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|encoding||Message encoding - 7 for GSM 7bit, 8 for Raw 8bit and 16 for Unicode&lt;br /&gt;
|-&lt;br /&gt;
|DelayHours||The hours to delay.&lt;br /&gt;
|-&lt;br /&gt;
|DelayMinutes||The minutes to delay&lt;br /&gt;
|-&lt;br /&gt;
|label||The label of this delayed event&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_flash''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|||The parameter message must be pre-encoded.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Additional parameters for type: &amp;quot;sms_wappush''''''&amp;quot;'''&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|recipient||The phone number to receive message, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|url||The pre-encoded URL&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no exception in API call, the following response (XML format) will be returned:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;RestResponse&amp;gt;&lt;br /&gt;
:&amp;lt;HasException&amp;gt;false&amp;lt;/HasException&amp;gt;&lt;br /&gt;
:&amp;lt;Token&amp;gt;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;lt;/Token&amp;gt;&lt;br /&gt;
:&amp;lt; SMSMessage&amp;gt;&lt;br /&gt;
::&amp;lt;Status&amp;gt;QUEUED or REJECTED&amp;lt;/Status&amp;gt;&lt;br /&gt;
::&amp;lt; Body&amp;gt;sms message&amp;lt;/ Body&amp;gt;&lt;br /&gt;
::&amp;lt; Recipient&amp;gt;16047891236&amp;lt;/ Recipient&amp;gt;&lt;br /&gt;
::&amp;lt;Type&amp;gt;sms&amp;lt;/Type&amp;gt;&lt;br /&gt;
::&amp;lt;TrackingId&amp;gt;MTID256749777469712848&amp;lt;/TrackingId&amp;gt;&lt;br /&gt;
::&amp;lt;RejectReason&amp;gt; &amp;lt;/RejectReason&amp;gt;&lt;br /&gt;
:&amp;lt;/ SMSMessage&amp;gt;&lt;br /&gt;
&amp;lt;/RestResponse&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In SMSMessage, TrackingId and RejectReason are optional. If Status is &amp;quot;QUEUED&amp;quot;, for non-multiple recipient type, a unique TrackingId is returned for future query. If Status is &amp;quot;REJECTED&amp;quot;, RejectReason includes the reject reason. If type is sms_test, the successful status is &amp;quot;PASSED&amp;quot;, not &amp;quot;QUEUED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in JSON format''' '''&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;HasException&amp;quot;: false,&lt;br /&gt;
  &amp;quot;Token&amp;quot;: &amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;,&lt;br /&gt;
  &amp;quot;SMSMessage&amp;quot;: {&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;QUEUED&amp;quot; or &amp;quot;REJECTED&amp;quot;,&lt;br /&gt;
    &amp;quot;Body&amp;quot;: &amp;quot;sms message&amp;quot;,&lt;br /&gt;
    &amp;quot;Recipient&amp;quot;: &amp;quot;16047891236&amp;quot;,&lt;br /&gt;
    &amp;quot;Type&amp;quot;: &amp;quot;sms&amp;quot;,&lt;br /&gt;
    &amp;quot;TrackingId&amp;quot;: &amp;quot;MTID256749777469712848&amp;quot;,&lt;br /&gt;
    &amp;quot;RejectReason&amp;quot;: &amp;quot;Failure message&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. SMS Contact API'''&lt;br /&gt;
&lt;br /&gt;
'''API URI: /RESTv1/{token}/Contact'''&lt;br /&gt;
&lt;br /&gt;
'''Support method: HTTP POST '''&lt;br /&gt;
&lt;br /&gt;
The following parameters are '''required''' in your POST to add contact:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|signature||One of the API credential, similar to a password. It can be found in your account page.&lt;br /&gt;
|-&lt;br /&gt;
|mobile||The mobile number to be added as an SMS contact, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212. If mobile number already exists, existing record will be updated.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following parameters are optional:&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|type||The mobile type, such as Android, iPhone.&lt;br /&gt;
|-&lt;br /&gt;
|email||The email of this SMS contact.&lt;br /&gt;
|-&lt;br /&gt;
|firstname||The given name of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|lastname||The surname of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|address||The living or working address of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|city||The living or working city of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|zipcode||The zipcode of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|landline||The landline of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|title||The title of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|role||The role of this SMS contact&lt;br /&gt;
|-&lt;br /&gt;
|organization||The organization this SMS contact belongs to&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If no exception in API call, the following response (XML format) will be returned:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;RestResponse&amp;gt;&lt;br /&gt;
:&amp;lt;HasException&amp;gt;false&amp;lt;/HasException&amp;gt;&lt;br /&gt;
:&amp;lt;Token&amp;gt;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;lt;/Token&amp;gt;&lt;br /&gt;
:&amp;lt;SMSContact&amp;gt;&lt;br /&gt;
::&amp;lt;success&amp;gt;true or false&amp;lt;/success&amp;gt;&lt;br /&gt;
::&amp;lt;number&amp;gt;16047891236&amp;lt;/number&amp;gt;&lt;br /&gt;
::&amp;lt;message&amp;gt;Success or failure message&amp;lt;/message&amp;gt;&lt;br /&gt;
:&amp;lt;/SMSContact&amp;gt;&lt;br /&gt;
&amp;lt;/RestResponse&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in JSON format''' '''&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;HasException&amp;quot;: false,&lt;br /&gt;
  &amp;quot;Token&amp;quot;: &amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;,&lt;br /&gt;
  &amp;quot; SMSContact &amp;quot;: {&lt;br /&gt;
    &amp;quot;success&amp;quot;: true or false,&lt;br /&gt;
    &amp;quot;number&amp;quot;: &amp;quot;16047891236&amp;quot;,&lt;br /&gt;
    &amp;quot;message&amp;quot;: &amp;quot;Success or failure message.&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Number Validation API'''&lt;br /&gt;
&lt;br /&gt;
'''API URI: /RESTv1/{token}/''' '''NumberValidation'''&lt;br /&gt;
&lt;br /&gt;
'''Support method: HTTP POST '''&lt;br /&gt;
&lt;br /&gt;
The following parameters are '''required''' in your POST to do number validation:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Parameter'''||'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|signature||One of the API credential, similar to a password. It can be found in your account page.&lt;br /&gt;
|-&lt;br /&gt;
|type||The validation type. There are three possible types. 1 – &amp;quot;quick&amp;quot; and it will cost 0.1 credits; 2 – &amp;quot;route&amp;quot; and it will cost 0.25 credits; 3 – &amp;quot;hlr&amp;quot; and it will cost 0.5 credits.&lt;br /&gt;
|-&lt;br /&gt;
|number||The phone number to be validated, in [http://en.wikipedia.org/wiki/E.164 E.164] format, for example 16045551212.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no exception in API call, the following response (XML format) will be returned:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;RestResponse&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;HasException&amp;gt;false&amp;lt;/HasException&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;Token&amp;gt;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;lt;/Token&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;NumberValidation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;success&amp;gt;true or false&amp;lt;/success&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;number&amp;gt;16047891236&amp;lt;/number&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;message&amp;gt;Success or failure message&amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;country&amp;gt;Canada&amp;lt;/country&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;network&amp;gt;British Columbia&amp;lt;/network&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;HLRLookupResultObject&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;number&amp;gt;16047891236&amp;lt;/number&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;MCC&amp;gt;302&amp;lt;/MCC&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;MNC&amp;gt;370&amp;lt;/MNC&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;operatorName&amp;gt;Microcell&amp;lt;/operatorName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;operatorCountry&amp;gt;Canada&amp;lt;/operatorCountry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::&amp;lt;message&amp;gt;&amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;/HLRLookupResultObject&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;/NumberValidation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/RestResponse&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In NumberValidation, country, network and  HLRLookupResultObject are optional, depends on the query type. If type is &amp;quot;quick&amp;quot;, only country returned; if type is &amp;quot;route&amp;quot;, country and network returned; if type is &amp;quot;hlr&amp;quot;, only HLRLookupResultObject returned.&lt;br /&gt;
&lt;br /&gt;
Or in JSON format&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;HasException&amp;quot;: false,&lt;br /&gt;
  &amp;quot;Token&amp;quot;: &amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;,&lt;br /&gt;
  &amp;quot;NumberValidation&amp;quot;: {&lt;br /&gt;
    &amp;quot;success&amp;quot;: true or false,&lt;br /&gt;
    &amp;quot;number&amp;quot;: &amp;quot;16047891236&amp;quot;,&lt;br /&gt;
    &amp;quot;message&amp;quot;: &amp;quot;Success or failure message.&amp;quot;,&lt;br /&gt;
    &amp;quot;country&amp;quot;: &amp;quot;Canada&amp;quot;,&lt;br /&gt;
    &amp;quot;network&amp;quot;: &amp;quot;British Columbia&amp;quot;&lt;br /&gt;
    &amp;quot;HLRLookupResultObject&amp;quot;: {&lt;br /&gt;
      &amp;quot;status&amp;quot;: &amp;quot;OK&amp;quot;,&lt;br /&gt;
      &amp;quot;number&amp;quot;: &amp;quot;16047891236&amp;quot;,&lt;br /&gt;
      &amp;quot;MCC&amp;quot;: &amp;quot;302&amp;quot;,&lt;br /&gt;
      &amp;quot;MNC&amp;quot;: &amp;quot;370&amp;quot;,&lt;br /&gt;
      &amp;quot;operatorName&amp;quot;: &amp;quot;Microcell&amp;quot;,&lt;br /&gt;
      &amp;quot;operatorCountry&amp;quot;: &amp;quot;Canada&amp;quot;,&lt;br /&gt;
      &amp;quot;message&amp;quot;: &amp;quot;&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The entire HLRLookupResultObject is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HLRLookupResultObject&amp;gt;&lt;br /&gt;
:&amp;lt;status&amp;gt;&amp;lt;/status&amp;gt;&lt;br /&gt;
:&amp;lt;number&amp;gt;&amp;lt;/number&amp;gt;&lt;br /&gt;
:&amp;lt;MCC&amp;gt;&amp;lt;/MCC&amp;gt;&lt;br /&gt;
:&amp;lt;MNC&amp;gt;&amp;lt;/MNC&amp;gt;&lt;br /&gt;
:&amp;lt;operatorName&amp;gt;&amp;lt;/operatorName&amp;gt;&lt;br /&gt;
:&amp;lt;operatorCountry&amp;gt;&amp;lt;/operatorCountry&amp;gt;&lt;br /&gt;
:&amp;lt;IMSI&amp;gt;&amp;lt;/IMSI&amp;gt;&lt;br /&gt;
:&amp;lt;MSC&amp;gt;&amp;lt;/MSC&amp;gt;&lt;br /&gt;
:&amp;lt;mscOperator&amp;gt;&amp;lt;/mscOperator&amp;gt;&lt;br /&gt;
:&amp;lt;mscMCC&amp;gt;&amp;lt;/mscMCC&amp;gt;&lt;br /&gt;
:&amp;lt;mscMNC&amp;gt;&amp;lt;/mscMNC&amp;gt;&lt;br /&gt;
:&amp;lt;mscCountry&amp;gt;&amp;lt;/mscCountry&amp;gt;&lt;br /&gt;
:&amp;lt;mscLocation&amp;gt;&amp;lt;/mscLocation&amp;gt;&lt;br /&gt;
:&amp;lt;message&amp;gt;&amp;lt;/message&amp;gt;&lt;br /&gt;
&amp;lt;/HLRLookupResultObject&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only status, number and message are mandatory, others are optional.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''REST API Exception'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there is any exception in REST API call, the HasException flag will be set to true and the following response (XML format) will be returned:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;RestResponse&amp;gt;&lt;br /&gt;
:&amp;lt;HasException&amp;gt;true&amp;lt;/HasException&amp;gt;&lt;br /&gt;
:&amp;lt;Token&amp;gt;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;lt;/Token&amp;gt;&lt;br /&gt;
:&amp;lt;RestException&amp;gt;&lt;br /&gt;
::&amp;lt;ErrorCode&amp;gt;101&amp;lt;/ErrorCode&amp;gt;&lt;br /&gt;
::&amp;lt;Message&amp;gt;Unauthorized&amp;lt;/Message&amp;gt;&lt;br /&gt;
::&amp;lt;Status&amp;gt;401&amp;lt;/Status&amp;gt;&lt;br /&gt;
:&amp;lt;/RestException&amp;gt;&lt;br /&gt;
&amp;lt;/RestResponse&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or in JSON format''' '''&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;HasException&amp;quot;: true,&lt;br /&gt;
  &amp;quot;Token&amp;quot;: &amp;quot;xxxxxxxx-8e4b-405b-998c-a580bf593b76&amp;quot;,&lt;br /&gt;
  &amp;quot;RestException&amp;quot;: {&lt;br /&gt;
    &amp;quot;ErrorCode&amp;quot;: &amp;quot;101&amp;quot;,&lt;br /&gt;
    &amp;quot;Message&amp;quot;: &amp;quot;Unauthorized&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;401&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Status is HTTP status code and it is optional.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ErrorCode and corresponding message:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''ErrorCode'''||'''Message'''||'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
|100||Unsupported method||Wrong HTTP method&lt;br /&gt;
|-&lt;br /&gt;
|101||Unauthorized||API credential is wrong&lt;br /&gt;
|-&lt;br /&gt;
|102||No permission||API credential passed, but no permission&lt;br /&gt;
|-&lt;br /&gt;
|103||Runtime error||Runtime error during API call&lt;br /&gt;
|-&lt;br /&gt;
|||||&lt;br /&gt;
|-&lt;br /&gt;
|200||Zero balance||No credits to send a message&lt;br /&gt;
|-&lt;br /&gt;
|201||Invalid country||Can’t figure out a country with the recipient number&lt;br /&gt;
|-&lt;br /&gt;
|202||Invalid carrier code||The carrier code is incorrect&lt;br /&gt;
|-&lt;br /&gt;
|203||Number blocked||The recipient number is blocked by our system&lt;br /&gt;
|-&lt;br /&gt;
|204||Too many messages||Message is too long&lt;br /&gt;
|-&lt;br /&gt;
|205||Empty message||Empty message&lt;br /&gt;
|-&lt;br /&gt;
|206||No time for defer||The delay parameter is wrong&lt;br /&gt;
|-&lt;br /&gt;
|207||Unknown type||Unknown message type&lt;br /&gt;
|-&lt;br /&gt;
|208||Unimplemented type||The message type not implemented yet&lt;br /&gt;
|-&lt;br /&gt;
|||||&lt;br /&gt;
|-&lt;br /&gt;
|300||Mobile phone number is invalid||Invalid mobile number&lt;br /&gt;
|-&lt;br /&gt;
|301||Credit is not enough to perform validation. Please purchase more and try again||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== '''Examples''' ==&lt;br /&gt;
&lt;br /&gt;
[[Java Example]]  |  [[CSharp Example]]  |  [[Java JSON Example]]  | [[CSharp JSON Example]]&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Bzurkovic</name></author>	</entry>

	</feed>