XML Protocol
Note
XML is only available for our SMS services.
Be advised
We highly recommend using our JSON protocol instead of our XML.
API endpoints
More information can be found in our Help Center.
- Global XML Endpoint URL:
https://gw.messaging.cm.com/gateway.ashx
Values should be XML encoded and XML element names are in capitals. The following characters must be escaped in the XML body:
Character | Escape value |
---|---|
" | " |
' | ' |
< | < |
> | > |
& | & |
POST requires a valid XML document, UTF-8 encoded. Values should be XML encoded and XML element names are in capitals. The following characters must be escaped in the XML body:
Character | Escape value |
---|---|
" | " |
' | ' |
< | < |
> | > |
& | & |
A POST containing JSON should be sent to a different URL. JSON keys are case insensitive.
<?xml version="1.0" encoding="utf-8"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<BODY>Test message</BODY>
</MSG>
</MESSAGES>
Batches - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<TO>00447911123457</TO>
<BODY>Test message</BODY>
</MSG>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>OtherSender</FROM>
<TO>00447911123458</TO>
<TO>00447911123459</TO>
<BODY>Other Test message</BODY>
</MSG>
</MESSAGES>
References - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<BODY>Test message</BODY>
<REFERENCE>your_reference</REFERENCE>
</MSG>
</MESSAGES>
Unicode - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<DCS>8</DCS>
<BODY>Κείμενο διαθέσιμο σε όλες τις γλώσσες</BODY>
</MSG>
</MESSAGES>
Auto-detection Unicode
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<MINIMUMNUMBEROFMESSAGEPARTS>1</MINIMUMNUMBEROFMESSAGEPARTS>
<MAXIMUMNUMBEROFMESSAGEPARTS>8</MAXIMUMNUMBEROFMESSAGEPARTS>
<BODY TYPE="AUTO">Κείμενο διαθέσιμο σε όλες τις γλώσσες</BODY>
</MSG>
</MESSAGES>
Multipart - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<MINIMUMNUMBEROFMESSAGEPARTS>1</MINIMUMNUMBEROFMESSAGEPARTS>
<MAXIMUMNUMBEROFMESSAGEPARTS>8</MAXIMUMNUMBEROFMESSAGEPARTS>
<BODY>Using these settings we can send SMS messages that contain more than 160 characters as if it is one message. Please do note that this limits the length of one message to 153 characters.</BODY>
</MSG>
</MESSAGES>
Custom Grouping - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<BODY>This message uses custom groupings</BODY>
<CUSTOMGROUPING>Campaign ABC</CUSTOMGROUPING>
<CUSTOMGROUPING2>Department XYZ</CUSTOMGROUPING2>
<CUSTOMGROUPING3>Source 123</CUSTOMGROUPING3>
</MSG>
</MESSAGES>
Push - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>SMS</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<BODY>This message defines allowed channels</BODY>
<ALLOWEDCHANNELS>Push</ALLOWEDCHANNELS>
<APPKEY>00000000-0000-0000-0000-000000000000</APPKEY>
</MSG>
</MSG>
</MESSAGES>
Hybrid - xml
<?xml version="1.0"?>
<MESSAGES>
<AUTHENTICATION>
<PRODUCTTOKEN>00000000-0000-0000-0000-000000000000</PRODUCTTOKEN>
</AUTHENTICATION>
<MSG>
<CHANNEL>Push</CHANNEL>
<FROM>SenderName</FROM>
<TO>00447911123456</TO>
<APPKEY>00000000-0000-0000-0000-000000000000</APPKEY>
<BODY>This message will be delivered as a push message.</BODY>
</MSG>
</MESSAGES>
Updated 3 months ago