Creating Messages from Templates

Access Endpoint URL: https://rest.everyware.com/api/default/createtemplatemessage [POST]

Using this method, you can send an SMS or MMS message to your customer or contact's mobile phone, with content generated from a template previously created in the portal.

📘

Creating and Using Templates

Templates must be created within the Everyware Portal UI (Left Navigation Bar: Messaging...SMS Templates) Acquire the unique template ID from the Template ID column in the 'Manage SMS Templates' table and use it for the API's SmsTemplateId input parameter.

📘

Creating a Customer

This also creates a new contact in the system, much like CreateCustomer. If the name and mobile phone do not match anyone in your Contact list, it will be added to your location's default contact list.

Inbound Parameters

Parameter NameDescriptionRequired/Not
FirstNameContact (customer/message recipient’s) first nameOPTIONAL
LastNameContact (customer/message recipient’s)last nameOPTIONAL
MobilePhoneContact (customer/message recipient’s) Valid mobile phoneREQUIRED
SmsTemplateIdUnique identifier of the SMS Template to useREQUIRED
ExternalIDUnique identifier Everyware can store optionally.OPTIONAL
AttachmentsAttachment string array for optional MMS attachmentsREQUIRED for MMS (see below)
Attachments - fileNameThe original name of the binary file, with expected extension. This is how the MMS attachment will be sent to the recipient.REQUIRED for MMS (see below)
Attachments - Base64StringThe Base64 encoded payload which represents the original file to be sentREQUIRED for MMS (see below)
fileURLURL file that belongs to the Attachment for MMS.REQUIRED for MMS (see
{
  "FirstName": "John",
  "LastName": "Doe",
  "MobilePhone": "5555551212",
  "SMSTemplateID": "405486",
  "ExternalID": "12345"
}
curl --location 'https://rest.everyware.com/api/Default/CreateMessage' \
--header 'Authorization: Basic [xxx]' \
--header 'Content-Type: application/json' \
--data-raw ' {
 "FirstName": "John",
  "LastName": "Doe",
  "MobilePhone": "5555551212",
  "SMSTemplateID": "405486",
  "ExternalID": ""
}'
{
    "OrderNumber": null,
    "SMSID": null,
    "IsSuccess": true,
    "Message": "Your template message was successfully sent.",
    "Data": "30812487"
}

🚧

Attachments Optional

If you are sending a simple SMS without attachments, you can either leave out the Attachments array, or include it with a null value

CreateMessage - MMS Sent With Base64 Encoding

{
    "MobilePhone": "5551112222",
    "SMSTemplateID": "405486",
    "Attachments": [
      {
        "fileName": "testImage1.png",
        "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
      }
    ]
}
curl --location 'https://rest.everyware.com/api/Default/CreateMessage' \
--header 'Authorization: Basic [xxx]' \
--header 'Content-Type: application/json' \
--data-raw ' {
 "FirstName": "John",
  "LastName": "Doe",
  "MobilePhone": "5555551212",
    "SMSTemplateID": "405486",
    "Attachments": [
    {
      "fileName": "testImage1.png",
      "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
    }
    ],
  "ExternalID": ""
}'
{
    "IsSuccess": true,
    "Message": "Your template message was successfully sent.",
    "Data": "7643431",
    "OrderNumber": null,
    "SMSID": null,
}

📘

Base64 Encoding

In order to send the binary file over the API, it must first be Base64 encoded for transmission.

CreateMessage - MMS Sent With External Linked File

{
    "MobilePhone": "5551112222",
    "SMSTemplateID": "405486",
    "Attachments": [
      {
        "fileName": "testImage1.png",
        "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
      }
    ]
}
curl --location 'https://rest.everyware.com/api/Default/CreateMessage' \
--header 'Authorization: Basic [xxx]' \
--header 'Content-Type: application/json' \
--data-raw ' {
 "FirstName": "John",
  "LastName": "Doe",
  "MobilePhone": "5555551212",
  "SMSTemplateID": "405486",
    "Attachments": [
    {
      "fileName": "testImage1.png",
      "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
    }
    ],
  "ExternalID": ""
}'
{
    "IsSuccess": true,
    "Message": "Your template message was successfully sent.",
    "Data": "7643431",
    "OrderNumber": null,
    "SMSID": null,
}

🚧

Prepare Your File Location

Make sure that the URL location mentioned in fileURL meets the following criteria:

  • Conforms to TLS1.2 standards
  • Is protected by HTTPS
  • Is open to the internet, not behind a firewall or anything that would prevent Everyware from retrieving the file.

CreateMessage - Sending Multiple MMS Attachments

{
    "MobilePhone": "5551112222",
    "SMSTemplateID": "405486",
    "Attachments": [
    {
      "fileName": "testImage1.png",
      "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
    },
{
      "fileName": "testImage2.png",
      "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
    }
  ]
}
curl --location 'https://rest.everyware.com/api/Default/CreateMessage' \
--header 'Authorization: Basic [xxx]' \
--header 'Content-Type: application/json' \
--data-raw ' {
 "FirstName": "John",
  "LastName": "Doe",
  "MobilePhone": "5555551212",
  "SMSTemplateID": "405486",
    "Attachments": [
    {
      "fileName": "testImage1.png",
      "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
    },
    {
      "fileName": "testImage2.png",
      "Base64String”: "[INSERT BASE64 ENCODED STRING]" 
    }
  "ExternalID": ""
}'
{
    "IsSuccess": true,
    "Message": "Your template message was successfully sent.",
    "Data": "7643431",
    "OrderNumber": null,
    "SMSID": null,
}

📘

Mixing Attachment sources

It is completely fine to mix how you send binary files in the Attachments array. You can send one Base64 encoded, and one via fileURL pickup, or any combination.

📘

RE: System

When a message is sent through the API, the sender will appear as "System" in the Messages page in the Everyware portal.