How can we help?

/messagedb/create


<base-url>/messagedb/create.[xml|json]
Example: https://127.0.0.1:7000/messagedb/create.json

Use this URL to create a single new message or multiple new messages in the server. Use the message status: ‘SCHEDULED‘ to automatically send out the message.

Create messages of any message type this way. Including SMS or E-mail messages. WhatsApp, Viber, RCS or other rich message formats should use the type ‘SMS‘. Look at the database structure to find all the fields that are available for each message type.

To send an image or media file through WhatsApp, Viber, RCS or any other rich message channel add the media as an attachment to the message. Normal SMS messages do not support attachments.

The end of this page shows the response body structure.

Post body – Send SMS

This sends a normal SMS message.

{
  "message": [
  {  
      "TypeID"                 : "SMS"
    , "StatusID"               : "SCHEDULED"
    , "ToAddress"              : "+316211223344"
    , "Body"                   : "Hello, this is a test from Auron Software"
  }]
}
<create>
  <message>
    <TypeID>SMS</TypeID>                 
    <StatusID>SCHEDULED</StatusID>               
    <ToAddress>+316211223344</ToAddress>              
    <Body>Hello, this is a test from Auron Software</Body>                   
  </message>
</create>

Post body – Send multiple SMS

Send multiple SMS messages in one call.

The LocalID property is an optional special message property that is not used by the server but will be returned as-is in the response body. The LocalID property is useful when creating multiple messages in one call. Use the LocalID to differentiate between result codes for each message in the response body.

Find the response body structure for multiple SMS messages below the create examples.

{
  "message": [
  {  
      "LocalID"                : 1
    , "TypeID"                 : "SMS"
    , "StatusID"               : "SCHEDULED"
    , "ToAddress"              : "+4433221100"
    , "Body"                   : "First test from Auron Software."
  } , { 
      "LocalID"                : 2
    , "TypeID"                 : "SMS"
    , "StatusID"               : "SCHEDULED"
    , "ToAddress"              : "+4433221100"
    , "Body"                   : "Second test from Auron Software"
  }]
}
<create>
  <message>
    <LocalID>1</LocalID>
    <TypeID>SMS</TypeID>
    <StatusID>SCHEDULED</StatusID>
    <ToAddress>+316211223344</ToAddress>
    <Body>Hello, World from Auron Software!</Body>
  </message>
  <message>
    <LocalID>2</LocalID>
    <StatusID>SCHEDULED</StatusID>
    <ToAddress>+316211223344</ToAddress>
    <Body>Hello, World from Auron Software!</Body>
  </message>
</create>

Post body – Send SMS with TLV

This examples shows how to add TLV’s to a message. Specify the value as:

  • ValueAsString – For C-Octet strings
  • ValueAsHexString – For binary information
  • ValueAsInt32 – For large integer values
  • ValueAsIn16 – For short integer values
  • ValueAsInt8 – For byte values
{
  "message": [
  {  
      "TypeID"                 : "SMS"
    , "StatusID"               : "SCHEDULED"
    , "ToAddress"              : "+4433221100"
    , "Body"                   : "TLV test from Auron Software."
    , "Tlvs"                   :
    [{
        "Tag"                  : 1
      , "ValueAsString"        : "Hello, World!"
     }
    ,{
        "Tag"                  : 2
      , "ValueAsHexString"     : "1234567890ABCDEF"
     }]    
  }]
}
<create>
  <message>
    <TypeID>SMS</TypeID>
    <StatusID>SCHEDULED</StatusID>
    <ToAddress>+316211223344</ToAddress>
    <Body>Hello, World from Auron Software!</Body>
    <Tlvs>
      <Tlv>
        <Tag>10</Tag>
        <ValueAsString>Hello, World!</ValueAsString>
      </Tlv>
      <Tlv>
        <Tag>20</Tag>
        <ValueAsHexString>1234567890ABCDEF</ValueAsHexString>
      </Tlv>
    </Tlvs>
  </message>
</create>

Post body – Send Whatsapp with image

Send rich text messages such as WhatsApp, Viber or RCS (Google chat) using the ‘SMS’ message type.

Any attached media file should be added as an attachment. Attachments need to be base64 encoded.

{
  "message": [
  {  
      "TypeID"                 : "SMS"
    , "StatusID"               : "SCHEDULED"
    , "ToAddress"              : "+4433221100"
    , "Body"                   : "Hi WhatsApp; I found this pixel online!"
    , "Attachments"            :
    [{                                             
        "Name"                 : "singlebluepixel.png"
      , "Base64"               : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAAUAAAAFAFcjIF8AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAA1JREFUCJlj4J7zswwABG0CF3wy73AAAAAASUVORK5CYII="
     }]    
  }]
}
<create>
  <message>
    <TypeID>SMS</TypeID>
    <StatusID>SCHEDULED</StatusID>
    <ToAddress>+316211223344</ToAddress>
    <Body>Hi WhatsApp; I found this pixel online!</Body>
    <Attachments>
      <Attachment>
        <Name>singlebluepixel.png</Name>
        <Base64>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAAU
        AAAAFAFcjIF8AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAA1J
        REFUCJlj4J7zswwABG0CF3wy73AAAAAASUVORK5CYII=</Base64>
      </Attachment>
    </Attachments>
  </message>
</create>

Post body – Send E-mail

You can create any message type supported by your server using the URL including E-mail messages. To send an e-mail just set the message type to ‘EMAIL’.

This example will send an e-mail message with an attachment. Attachments need to be base64 encoded.

{
  "message": [
  {  
      "TypeID"                 : "EMAIL"
    , "StatusID"               : "SCHEDULED"
    , "ToAddress"              : "youremail@example.com"
    , "CcAddress"              : "anotheremail@example.com"
    , "BodyPlainText"          : "Hi, I found this pixel online!"
    , "BodyHtml"               : "<h1>Hi, I found this pixel online!</h1>"
    , "Attachments"            :
    [{                                             
        "Name"                 : "singlebluepixel.png"
      , "Base64"               : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAAUAAAAFAFcjIF8AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAA1JREFUCJlj4J7zswwABG0CF3wy73AAAAAASUVORK5CYII="
     }]    
  }]
}
<create>
  <message>
    <TypeID>EMAIL</TypeID>
    <StatusID>SCHEDULED</StatusID>
    <ToAddress>youremail@example.com</ToAddress>
    <CcAddress>anotheremail@example.com</CcAddress>
    <BodyPlainText>Hi, I found this pixel online!</BodyPlainText>
    <BodyHtml>&lt;h1&gt;Hi, I found this pixel online!&lt;/h1&gt;</BodyHtml>
    <Attachments>
      <Attachment>
        <Name>singlebluepixel.png</Name>
        <Base64>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAAU
        AAAAFAFcjIF8AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAA1J
        REFUCJlj4J7zswwABG0CF3wy73AAAAAASUVORK5CYII=</Base64>
      </Attachment>
    </Attachments>
  </message>
</create>

Response body

The database ID as well as an error code and an error description. The LocalID in this example is an empty set since no local ID was given for the new message.

{
   "result":[
      {
         "LocalID":"[]",
         "ID":"95556",
         "LastError":0,
         "LastErrorDescription":"Success"
      }
   ]
}
<response>
  <result>
    <LocalID></LocalID>
    <ID>95557</ID>
    <LastError>0</LastError>
    <LastErrorDescription>Success</LastErrorDescription>
  </result>
</response>

Response body – Multiple message

Use the special message property ‘LocalID’ to differentiate between messages when creating multiple messages at once.

{
   "result":[
      {
         "LocalID":"1",
         "ID":"95562",
         "LastError":0,
         "LastErrorDescription":"Success"
      },
      {
         "LocalID":"2",
         "ID":"95563",
         "LastError":0,
         "LastErrorDescription":"Success"
      }
   ]
}
<response>
  <result>
    <LocalID>1</LocalID>
    <ID>95558</ID>
    <LastError>0</LastError>
    <LastErrorDescription>Success</LastErrorDescription>
  </result>
  <result>
    <LocalID>2</LocalID>
    <ID>95559</ID>
    <LastError>0</LastError>
    <LastErrorDescription>Success</LastErrorDescription>
  </result>
</response>