MMP SMS Interface

This page explains an SMS Integration Interface when integrating your mobile operator with the Dengage MMP Engine.

using System;
using System.Collections.Generic;

namespace MMP.MTA.SmsInterface
{
    public interface ISmsMessage
    {
        // SecretKey is a key. Login function must check it and set it as logged in if the secret is ok. 
        // Returns: "OK" - logged in, "NOK": wrong secret and no other functions can be called.
				// NOTICE: You can return "OK" for onpremise environments that connect to the mobile operator directly.
        string Login(string secretKey);

        // Send (Request)
        //{
        //	"messages":
        //	[
        //		{
        //			"mobileNumber":"905332141354",							REQUIRED
        //			"text":"message to send",								REQUIRED
        //          "sender": "sender_name",								OPTIONAL
        //          "startTime": "datetime",								OPTIONAL
        //          "expireTime":"datetime"                               	OPTIONAL
        //		    "priority": "yes/no"									OPTIONAL
        //          "smsType": string                                       OPTIONAL -> Is used to understand the type of the sending: // default:BULK, OTP, TCKN, TAXNO
        //          "smsOperator: string                                    OPTIONAL -> The sublayer may fill this field in order to understand which operator we have relayed the message.
        //		},
        //		{
        //			"mobileNumber":"905330000000",                          -- mobile number
        //			"text":"message to send"                                -- text to send.
        //		},
        //		{
        //			"mobileNumber":"905330000000",
        //			"text":"message to send"
        //		},
        //		{
        //			"mobileNumber":"905330000000",
        //			"text":"message to send"
        //		}
        //	]
        //}
        // Send Response
        //{
        //	"results":
        //	[
        //		{
        //			"partnerMessageId":"message_id",                    -- message id assigned by sms provider
        //			"partnerStatus":"status coming from partner",       -- partner status of message 
        //			"partnerDetail":"detail coming from partner",       -- partner detail of message       
        //			"apiStatus":"status mta core expects" OK, FAIL      -- OK: we have delivered and we will wait for the report, FAIL: This is a final state for this item. No need to wait for the report, output the item.
        //		},
        //		{
        //			"partnerMessageId":"message_id",
        //			"partnerStatus":"status coming from partner",
        //			"partnerDetail":"detail coming from partner",
        //			"apiStatus":"status mta core expects",  OK, FAIL
        //		},
        //		{
        //			"partnerMessageId":"message_id",
        //			"partnerStatus":"status coming from partner",
        //			"partnerDetail":"detail coming from partner",
        //			"apiStatus":"status mta core expects"
        //		}
        //	]
        //}
        string Send(string request);

        // 
        // Report Request: 
        // {"messages":["message_id_1", "message_id_2", ...]}
        //
        // Report Response:
        //{
        //	"results":
        //	[
        //		{
        //			"partnerStatus":"status coming from partner",
        //			"partnerDetail":"detail coming from partner",                
        //      "sendAt":"time to send",
        //			"apiStatus":"status mta core expects" -- Final States: DELIVERED, FAIL, TIMEOUT  Other State: WAITING
        //		},
        //		{
        //			"partnerStatus":"status coming from partner",
        //			"partnerDetail":"detail coming from partner",
        //      "sendAt":"time to send",
        //			"apiStatus":"status mta core expects",  OK, FAIL
        //		}
        //	]
        //}
        //
        //
        //
        //
        string Report(string request);

        // Destroy object
        void Destroy();
    }

    // This class is used to pass the send request from mmp core to dll
    public class SmsSendRequest
    {
        public IList<SmsMessage> messages { get; set; }
        public class SmsMessage
        {
            public string mobileNumber { get; set; }
            public string text { get; set; }
            public string sender { get; set; }
            public string startTime { get; set; } // yyyyMMddHHmm
            public string expireTime { get; set; } // yyyyMMddHHmm
            /// <summary>
            /// Format: $"BULK|{accId}-{sendId}-{contactId}-{msgId}"
            /// BULK, OTP, TCKN, TAXNO
            /// </summary>
            public string smsType { get; set; } // BULK, OTP, TCKN, TAXNO 
            public string brandCode { get; set; }
            public string recipientType { get; set; }
            public string messageType { get; set; }
						// The accountId value is used to identify the sending account in environments with multiple accounts.
            public int accountId { get; set; } = 0;
						// senderId is used to identify sender definitions that have the same sender name but belong to different mobile operators. 
            public int senderId { get; set; } = 0;
        }
    }

    public class SmsReportRequest
    {
        public string partnerPacketId { get; set; } = string.Empty;
        public IList<string> messages { get; set; } = new List<string>();
    }


    // This class is used to pass the response to a send request from dll to mmp core
    public class SmsResponse
    {
        public string partnerPacketId { get; set; } = string.Empty;
        public IList<ReportResponse> results { get; set; } = new List<ReportResponse>();

        public class ReportResponse
        {
            public string partnerMessageId { get; set; } = string.Empty;
            public string partnerStatus { get; set; } = string.Empty;
            public string partnerDetail { get; set; } = string.Empty;
            public string apiStatus { get; set; } = string.Empty;
            public string sendAt { get; set; } = ""; // yyyyMMddHHmm
            public string smsOperator { get; set; } = "";
            public int smsMessageCount { get; set; }
        }
    }
}

Please download the interface dll from here: https://xfer.dengage.com/mmp/mmp.abstract.zip