Adeona SMS API v2.5
Adeona SMS API v2.5
2.4 2023-06-16
v Sadisha A new error codes were
introduced in SMS API
version 2 and send SMS
via GET requests to
indicate if too many
requests were detected
from the user.
2.5 2023-06-22 Roshan E-SMS API request
limitations were defined.
Request Parameters
Parameter name Description Mandatory/ Optional Data type
username Username registered Mandatory String
with Smart Messenger
password Password
v registered Mandatory String
with Smart Messenger
"username": "947xxxxxxxx",
"password": "ABC"
If success
{
"status": "success", v
"comment": "You have logged in",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDgxMiwidXNlcm5hbW
UiOiJzYWRpc2hh",
"remainingCount": null,
"expiration": 43200,
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX.JpZCI6NDgxMiwidXNlcm5hb
WUiOiJzYWRpc2hh",
"refreshExpiration": 604800,
"userData": {
"id": <user_id>,
"fname": <fname>,
"lname": <lname>,
"address": <address>,
"mobile": <user_mobile>,
"email": <user_email>,
"defaultMask": <user_deafault_mask>,
"additional_mask": [
{
"mask": <mask_1>
},
{
"mask": <mask_2>
Note: token received in the above success response should be used as the Authorization token.
EX: "Bearer<space>" + token
If failed
{
"status": "failed", v
"comment": <reason>,
"token": null,
"remainingCount": <remaining login attempts>,
"expiration": null,
"refreshToken": null,
"refreshExpiration": null,
"userData": null,
"data": "",
"errCode": <corresponding error code>
}
Request Parameters
Header Parameter Description Mandatory/ Optional Data type
name If optional value
should be empty
Ex:
[
{
mobile: ”7XXXXXXXX”
},
{
mobile: ” 7XXXXXXXX”
}
]
],
"push_notification_url": " https://xxx/xx?",
}'
If success
{
"status": "success",
"comment": "Campaign Created, Campaign ID <campaign_id>, Campaign payment of (LKR)
<campaign_cost> was successful",
"data": {
"campaignId": <campaign_id>,
"campaignCost": <campaign_cost>,
"walletBalance": <available_wallet_balance>,
"userMobile": <user_mobile>,
"userId": <user_id>,
"duplicatesRemoved": <duplicates_removed_from_the_msisdn_list>,
"mask_blocked_numbers": <mobiles_who_blocked_the_mask>,
If failed
{
"status": "failed",
"comment": "<reason>",
"data": "",
"errCode": <relevant_eror_code>
}
Note: SMS API has demonstrated its reliability and efficiency within the tested limit of 1000
v is designed to handle high message volumes, surpassing this
recipient numbers. While the API
limit may have adverse effects on its performance for the particular user. We strongly advise
against exceeding the recommended limit to prevent potential disruptions in service, delayed
message delivery, or degraded performance.
Version 2 is the updated version for checking campaign status using transaction id. This version
is optimized compared to its predecessor.
Request Parameters
Header Parameter Description Mandatory/ Optional Data type
name If optional value
should be empty
Response
Parameter name Description Mandatory/ Data type
Optional
status Status of the Mandatory String
request
comment Comment to find Mandatory String
the failure reason if
failed
data Data Object Optional Object
This is empty for a
v failed response
data -> campaign status Status of the Optional String
created campaign
errCode Corresponding Mandatory String
Error Code
transaction_id Transaction ID sent Mandatory Int
by the user
If success
{
"status": "success",
"comment": "campaign found for the transaction id:<id> ",
"data": {
"campaign status": "completed"
},
"errCode": "",
"transaction_id": "<transaction_id>"
}
Apache Maven
<dependency>
v
<groupId>net.adeonatech</groupId>
<artifactId>SmsAPI</artifactId>
<version>1.0.5</version>
</dependency>
tokenBody.setUsername("nimal");
tokenBody.setPassword("Admin#67!");
example:
String campaignStatus =
sendSMS.getTransactionIDStatus(transactionBody,sendSMS.getToken(tokenBody).getToken()).getDataTransaction
().getCampaign_status();
<?php
?>
$tokenBody->setUsername("nimal”);
$tokenBody->setPassword("Admin#67!");
$token = $sendSmsImpl->getToken($tokenBody)->getToken();
v
5. Set transaction id through object:
$sendTextBody->setTransactionId(<YOUR TRANSACTION ID>);
$sendTextBody->setSourceAddress("source1");
$sendTextBody->setMsisdn($sendSmsImpl->setMsisdns(array("71XXXXXXX","71XXXXXXX")));
$sendTextBody->setTransactionId("146");
$sendTextBody->setMessage("Hi this is test from PHP");
Prerequisite: ESMS admin has to provide the ability to use this functionality. By default, it is not
available.
Request Params
Parameter name Description Mandatory/ Optional Data type
(11digits)
source_address Source address or the mask Optional (If not defined, String
which is visible to customer. default mask of the user
will be used)
Note:
0: payment via wallet
4: payment via package
If paymentType is not defined or
empty, it is considered as a
payment made via wallet.
Sample Request v
https://e-sms.dialog.lk/api/v1/message-via-url/create/url-
campaign?esmsqk=eyJhbGciOiJIUzI1NiIsInR5c&list=0799999999,
799999999,94799999999&source_address=test&message=Welcome&push_notification_url=ht
tps://xx/xx'
If success
1
If failed
<error_id>
v
Note: Get Request SMS API has demonstrated its reliability and efficiency within the tested limit
of 100 recipient numbers. While the API is designed to handle high message volumes, surpassing
this limit may have adverse effects on its performance for the particular user. We strongly advise
against exceeding the recommended limit to prevent potential disruptions in service, delayed
message delivery, or degraded performance.
Above response id(s) only valid for send SMS via get requests (section 7).
Request Params
Parameter name Description Mandatory/ Data type
Optional
If optional value
should be empty
esmsqk Client key tov send messages via GET Mandatory String
requests. This can be generated via eSMS
user portal. eSMS user account can only
have one key.
(If a new key is generated, the old key will
be invalid)
Sample Request
https://e-sms.dialog.lk/api/v1/message-
viaurl/check/balance?esmsqk=eyJhbGciOiJIUzI1NiIsInR5c
If success
1|<balance>
Pipe mark separate the status and the balance. In the above,1 is the success and it is followed by
“|” and then the account balance
If failed
<error_id>|0
Response id Description
1|<balance> Success
2001|0 Error occurred during campaign creation
2002|0 Bad request
2006|0 Not eligible to send messages via get
requests (Admin haven’t provided the
access level)
2007|0 Invalid key (esmsqk parameter is invalid)
Above response id(s) only valid for send SMS via get requests (section 8).
Following is the format that eSMS system is calling 3rd party platforms. Therefore, it is mandatory
to implement delivery report end point as per below.
For delivery success scenario eSMS will send status code 1 and 3. Order of the status code
submission is not guaranteed. Therefore, its 3rd parties responsibility to develop the application
processing accordingly.