Get Started

Introduction

The Tingg Engage API is a single global entry point for all transactional alerts into the engage ecosystem. It is the interface provided for all our customers.
This service used to send single SMS requests that are transactional. This means that after an external service performs an action and requires to inform a user via sms, it invokes this API. The category of messages that can be sent out is OTPs, TRX (transactional) or just normal messages. This API can be invoked by internal services within Cellulant or external customers.
This API receives requests to send SMSs or Emails. Before an SMS or email can be sent using this API, the following are the prerequisites that need to be done on the Tingg Engage platform.

  1. Set up a notification template for either SMS or email
  2. Set up an MNO connector that will be used to send SMSs

Payloads

Generate Token

Below is the expected payload used to invoke the get token endpoint.

Api endpoint: https://api-dev.tingg.africa/api/v1/cas/authenticate

{
   "username":"TEST_USER",
   "password":"TEST_PASSWORD"
}

ParameterTypeMandatoryDescription
Username
{username}
StringYESThe username shared to get a token.
Password
{password}
StringYESThe password required to login to the platform.

Generate Token Response

Below is the response we get once we invoke the generate token endpoint

{
    "token_type": "bearer",
    "expires_in": 3600,
    "access_token": "eyJraWQiOiJjYXMtcGsiLCJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI3IiwicGFyZW50IjoiR2VvcmdlX0dhdGhlY2EiLCJsZXZlbCI6IkNVU1RPTUVSIiwiaXNzIjoiaHR0cDovL2Nhcy1hcGkuZGV2ZWxvcG1lbnQ6ODA4MC8iLCJ1dHlwZSI6IkFQSSIsImF1ZCI6Ik1lc3NhZ2luZ1BsYXRmb3JtIiwicGhvbmUiOiIyNTQ3MjEwMDIwMCIsIm5hbWUiOiJyZWNvbi1hZG1pbiIsImNsaWVudCI6Ikdlb3JnZV9HYXRoZWNhIiwiZXhwIjoxNjg4NDYxNDE1LCJpYXQiOjE2ODg0NTc4MTUsImN1c3RfaWQiOjEsImp0aSI6IjI1NThjMDc2LTk0M2MtNGVjOS1iYzhiLWQ4MTUxNjlmMTcyYWQ5Yjc4MzE2LWQ0ODUtNDcwYi1hY2VmLWFkYTRmM2FjYjgyMCIsImVtYWlsIjoicmVjb24tYWRtaW5AY2VsbHVsYW50LmNvbSJ9.IjjLJJ8fvsKhuMW4kagi7uPT2vYrajILNDSAmtudWJFO97USs45kXmc32u3PGegMUM50hVfFyCbXIkcSbndPkZvts4-Sv9rWFvQgUKukJLDmMLlGCwIxanPyRFVdphFRT4HCfJgQG1ZTjVlPPqjylxLHeG3QdQBHsoP38yU08oK0JnKQOn6o7LZ_humxz0TKUBrvYtfH9io_syRs6RvwTe3z2Zq1dG97RHCLfZkEYiXRbUD28GOd4PJEiZ3iWD4xeUL9OBnQtk2smCSBIXsbr788nbk4wGsarj_sFZAXqsqgKZGazHr7I3WXvxllKLrkk_xX42wl_-1wOqQPwVkF7Q",
    "refresh_token": "eVZnMVd3OWpTTFF2MEd5Wm04eWFjRlkySjd4NEt0bmovYmQyNlFid3hmdDJIcVQyVnVucGlIV2VBTjhBTjJzZWJ2bHV0SFJWUnBrMzRXZGkzQjdpOVE9PQ=="
}
ParameterTypeMandatoryDescription
Token Type
{token_type}
StringYESThis tells us the type of token to expect.
Expires In
{expires_in}
StringYESThis tells us how long the token is valid.
Access Token
{access_token}
StringYESThis holds the token to be used.

### Engagement Service API V2 Payload SMS

Below is the payload that is used to invoke the engagement service api for processing a single request.
Please note that to invoke the endpoint provide a bearer token which the token is generated from 2.1 above and the response seen on 2.2

Api endpoint: https://api-dev.tingg.africa/api/v2/engagement

{
  "notificationType": "SMS_TEST",
  "channels": [
    "SMS"
  ],
  "referenceID": "cas-123",
  "callbackUrl": "https://client.callback.url/",
    "smsDto": {
    "smsType": "TRX",
    "msisdn": [
      "254700000000",
      "254700000000"
    ],
    "message": "Test message ${placeholder}",
    "params": {
      "placeholder": "value"
    },
    "extraData": {
      "clientinfo": "additional client info"
    }
  }
}

ParameterTypeMandatoryDescription
Notification Type
{notificationType}
StringYESThe type of notification message to be sent.
Message
{message}
StringYESThe default message content for the notification. Will be used if no template exists.
Reference ID
{referenceID}
StringYESLocal reference for the message request. Has to be unique per request
CallbackURL
{callbackURL}
StringNOContains the callback url
MSISDN
{msisdn}
ListNOThe recipient address if the message is to be sent via phone number
Email Address
{email}
ListNOThe recipient address if the message is to be sent using an email address
Parameters
{params}
ObjectNOMessage template parameters. Will be used to formulate the final message from the template.
Channels
{channels}
ObjectYESThis is used to hold the channels you want your message to be explicitly sent with. If one does not specify we will use the default ones configured

Response Payload

Below is the expected payload response structure

{
     "transactionID": "{uuid}",
     "statusCode": 200,
     "message": "Message queued successfully."
}


ParameterTypeMandatoryDescription
Transaction ID
{transactionID}
StringYESThe unique ID assigned to the request on the engagement platform.
Status Code
{statusCode}
IntegerYESThe status of the request.
Message
{message}
StringYESA short description on the current request status.

Callback URL Response

The below response payload is sent to the callback URL provided.

Parameter NameTypeMandatoryDescription
Transaction ID {refId}StringYesLocal reference for the message request.
Status Code {status}IntegerYesThis represents status of the transaction.
Msisdn {msisdn}StringYesThe recipient address if the message is to be sent via phone number.
Status Description {statusDescription}StringYesA description regarding the current state of the transaction.
Timestamp {timestamp}StringYesThe time period when the payload was created.
Received Time
{receivedDateTime}
StringYesThis indicates the time the request was received on our systems.
Submit Time
{submitDateTime}
StringNoThis indicates the time the request was sent to the operator.
Done Time
{doneDateTime}
StringNoThis indicates the time the message was marked in final status.

Sample Response

{
    "refId": "0103fd2e-e784-469f-8cee-7d87720f2b98_6371f87b-aa3b-4387-850d-c6aa1153286a9",
    "status": 103,
    "msisdn": "254773301164",
    "statusDescription": "Forwarded to operator",
    "timestamp": "2024-04-11T09:34:31.066667",
    "receivedDateTime": "2024-04-11 09:34:30.749",
    "submitDateTime": "2024-04-11 09:34:30.761",
    "doneDateTime": null
}

Status Codes

Status CodesDescriptionFinal Status
100SMS pending and being processed within Cellulant’s systems.false
102Error during preprocessing of message. Check description to determine what is wrong with the requesttrue
105Error during preprocessing of message. Check description to determine what is wrong with the requesttrue
103Sms has been forwarded to the mobile network operator. Pending a delivery receipt from the mobile network operatorfalse
104Sms processed and delivered successfully.true
129Delivery of SMS failed on the mobile network operator side.true