🚧

Note

XML is only available for our SMS services.

❗️

Be advised

We highly recommend using JSON instead of 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:

CharacterEscape value
""
''
<&lt;
>&gt;
&&amp;

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:

CharacterEscape value
"&quot;
'&apos;
<&lt;
>&gt;
&&amp;

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>

Resonses & Errors

When sending a request with an invalid part to the XML gateway, NO MESSAGES are created and the entire request is rejected. You will receive a plain text response with details why the request was rejected.

Example response of a failed XML request:

Status: 200 OK

Error: ERROR No account found for the given authentication

XML POST responses

HTTP statusError textRemarks
400(none)No HTTP GET or POST was used to send your request
200Error: ERRORUnknown error An unexpected error occurred. Check the provided values. Contact CM for support.
200(empty)The request was accepted
200Error: ERROR No account found for the given authenticationNo account found for the provided product token.
200Error: ERROR Insufficient balance.Trial accounts only: You are out of trial messages. Order new messages via your dashboard. If you are a regular prepaid customer, you will be notified that you have run out of quota in a Status Report.
200Error: ERROR Message is unrouteable.Your request could not be routed. Contact CM for support.
200Error: ERROR Invalid product token.Invalid or missing product token
200Error: ERROR No FROM field found in a MSG node.The ‘FROM’ element is missing within the ‘MSG’ element
200Error: ERROR A MESSAGES node requires at least one MSG nodeA MSG node within the MESSAGE node is required and is missing.
200Error: ERROR No phone numbers found. Message will not be sent.The Phone Number value for the TO element is missing
200Error: ERROR Rejected: Gsm '' is not a number.The value for the TO element is not a valid Phone Number

See https://developers.cm.com/messaging/docs/incoming-status-report#standard-errors for a description of the standard errors.


Did this page help you?