Skip to main content

Messaging API

Send Message

This endpoint allows you to send one or multiple messages (SMS or email) using a predefined template. It supports personalized payloads per recipient.

  • URL: /api/SendMessages
  • Method: POST
  • Authentication: Basic Auth
  • Content-Type: application/json

Request Parameters

FieldTypeRequiredDescription
templateIdinteger✅ YesID of the SMS or email template to use.
scheduleDatedatetime❌ OptionalDate/time to send the message (ISO 8601 format, e.g. 2023-06-10T10:00:00+03:00).
recipientsarray✅ YesList of recipient objects (see structure below).

Each recipient object includes:

FieldTypeRequiredDescription
uniqueIdstring✅ YesUnique identifier for this recipient (e.g. customer ID). Must be unique per call.
cardNumberstring❌ OptionalLoyalty card number or customer code. If set, message will be recorded in CRM.
emailstring✔ If emailRequired if sending an email.
mobilePhonestring✔ If SMSRequired if sending an SMS. Must be a valid mobile number according to allowed countries list.
payloadobject❌ OptionalKey-value pairs for personalization tag replacement in the template.

Sample Request - Promo Code


{
"templateId":71,
"scheduleDate":"2016-05-12T10:00:00+03:00",
"recipients":
[
{
"uniqueId":"CustomerIdA",
"email":"[email protected]",
"mobilePhone":"6936862208",
"password":"ABC123",
"payload":
{
"voucherCode": "SPRING19",
"voucherAmount": "100 €",
"expirationDate": "28/09/2019"
}
},
{
"uniqueId":"CustomerIdB",
"email":"[email protected]",
"mobilePhone":"1936862208",
"password":"XXXYYY",
"payload":
{
"voucherCode": "VIP-SALES",
"voucherAmount": "200 €",
"expirationDate": "28/09/2019"
}
}
]
}

Response Properties

FieldTypeDescription
dispatchlongUnique ID assigned to this message dispatch.
totalRecipientsintegerTotal number of recipients included in the request.
totalRecipientsSentintegerNumber of recipients that passed validation and will receive the message.
invalidRecipientsintegerNumber of recipients that failed validation and were excluded.
sendDatedatetimeScheduled time for message delivery (in ISO 8601 format with timezone).
invalidEmailsarrayArray of invalid email addresses (if message type is email).
invalidMobilesarrayArray of objects with uniqueId and mobile fields for invalid phone numbers.

Sample Response

{
"dispatch": 180249,
"totalRecipients": 2,
"totalRecipientsSent": 1,
"invalidRecipients": 1,
"sendDate": "2016-05-12T10:00:00+03:00",
"invalidEmails": [],
"invalidMobiles": [
{
"uniqueId": "CustomerIdB",
"mobile": "1936862208"
}
]
}

Get Dispatch Results

This endpoint returns the status and metadata of a previously submitted message dispatch.

  • URL: /api/Dispatches/{DispatchId}
  • Method: GET
  • Authentication: Basic Auth

Replace {DispatchId} with the dispatch ID returned from the /api/SendMessages call.

Response Properties

FieldTypeDescription
dispatchIdlongThe ID of the requested dispatch.
campaignMessageIdintegerID of the message template used in the dispatch.
createdAtdatetimeTimestamp when the dispatch request was received.
startedQueuingAtdatetimeTimestamp when message queuing started.
finishedQueuingAtdatetimeTimestamp when message queuing finished.
messageTypeIdintegerMessage type: 1 = SMS, 2 = Email.
hasStartedQueuingbooleanIndicates if the queuing process has started.
hasFinishedQueuingbooleanIndicates if the queuing process has completed.
totalRecipientsintegerTotal number of recipients included in the dispatch.
sendStatusIdintegerDispatch status:
- 1: Draft
- 2: Pending
- 3: Queued
- 7: Error
errorMessagestringError message, if the dispatch encountered a failure.
queueAtdatetimeWhen messages were requested to be queued.
sendAtdatetimeWhen messages were scheduled to be sent.
isTestbooleanIndicates whether this was a test dispatch.
isInitializedbooleanTrue if the dispatch initialization is complete.
lastUpdatedatetimeTimestamp of the last update (if applicable).
legacyCode1stringOptional legacy identifier.
gatewayIdstringOptional gateway identifier.
gatewayId1stringOptional second gateway identifier.
creationDatedatetimeDate the dispatch was originally created.
modifiedDatedatetimeDate the dispatch was last modified.

Sample Response

{
"dispatchId": 180249,
"campaignMessageId": 71,
"scheduleId": null,
"createdAt": "2017-08-18T11:17:50.26",
"startedQueuingAt": "2017-08-18T11:17:51.837",
"finishedQueuingAt": "2017-08-18T11:17:51.97",
"messageTypeId": 1,
"isTest": false,
"isInitialized": true,
"hasStartedQueuing": true,
"hasFinishedQueuing": true,
"totalRecipients": 1,
"sendStatusId": 3,
"errorMessage": null,
"lastUpdate": null,
"queueAt": "2016-05-12T10:00:00",
"sendAt": "2016-05-12T10:00:00",
"legacyCode1": null,
"gatewayId": "",
"gatewayId1": "",
"creationDate": "2016-05-12T10:00:00",
"modifiedDate": "2016-05-12T10:00:00"
}