0% found this document useful (0 votes)
74 views10 pages

MRAM SMS API Documentation

The MRAM SMS API documentation provides detailed instructions on generating an API key, sending SMS, checking credit balance, and retrieving delivery reports. It includes API endpoints, parameters, error codes, and code examples in various programming languages. Users must obtain approval from MRAM SMS authority after generating their API key to ensure message delivery.

Uploaded by

Md.Abu Tayeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views10 pages

MRAM SMS API Documentation

The MRAM SMS API documentation provides detailed instructions on generating an API key, sending SMS, checking credit balance, and retrieving delivery reports. It includes API endpoints, parameters, error codes, and code examples in various programming languages. Users must obtain approval from MRAM SMS authority after generating their API key to ensure message delivery.

Uploaded by

Md.Abu Tayeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MRAM SMS API Documentation

Wakil Tower (8th Floor), Ta-131


Gulshan Badda Link Road, Dhaka-1212
Email: info@[Link]
Website: [Link]

Table of Contents
1. How to Generate API Key
2. API Parameters
3. Send SMS API
4. Credit Balance API
5. Delivery Report API
6. Inbox Reply API
7. API Key Retrieval
8. Error Codes
9. DLR Status Codes
10. Code Examples

How to Generate API Key


1. Login to the SMS panel
2. Navigate to Developers section
3. Click on Regenerate Key
4. Your API Key will be displayed: demo63************.********

Important: After generating your API key, you must get approval from MRAM SMS authority.
Otherwise, your messages will be automatically denied by the system.
API Parameters
Parameter Type Description

api_key String Your API Key (e.g., demo63************.********)

type String text for normal SMS / unicode for Bangla SMS

senderid String Sender ID (found in Messaging > Sender ID)

contacts String Mobile numbers separated by + (e.g.,


88017XXXXXXXX+88018XXXXXXXX+88019XXXXXXXX)

msg String SMS body content (use URL encoding for special characters like &, $,
@)

scheduledDateTime String Optional - Schedule date and time for SMS delivery

Send SMS API


API URL (GET & POST)

[Link]
{NUMBER}&senderid={ApprovedSenderID}&msg={MessageContent}

One To Many - JSON Format

json
{
"type": "post",
"url": "[Link]
"data": {
"api_key": "{your api key}",
"senderid": "{sender id}",
"type": "{content type}",
"scheduledDateTime": "{schedule date time}",
"msg": "{your message}",
"contacts": "88017xxxxxxxx+88018xxxxxxxx"
}
}

Many To Many - JSON Format

json

{
"type": "post",
"url": "[Link]
"data": {
"api_key": "{your api key}",
"senderid": "{sender id}",
"scheduledDateTime": "{schedule date time}",
"messages": [
{
"to": "88017xxxxxxxx",
"message": "test sms content …"
},
{
"to": "88018xxxxxxxx",
"message": "test sms content …"
}
]
}
}

Note: The messages parameter expects an array of objects with separate mobile numbers and
SMS text.

Credit Balance API


Check your current SMS credit balance.
API URL:

[Link]

Parameters:

API_KEY : Your API Key (demo63************.********)

Delivery Report API


Get All Delivery Reports

[Link]

Parameters:

API_KEY : Your API Key


Chunk per Call: 100

Get Specific SMS Delivery Report

[Link]

Parameters:

API_KEY : Your API Key


SMS_SHOOT_ID : The SMS ID returned when you submitted the SMS via API

Returns: Array with mobile numbers and their DLR status

Inbox Reply API


Retrieve unread replies from recipients.
API URL:
[Link]

Parameters:

API_KEY : Your API Key (demo63************.********)

API Key Retrieval


Retrieve your API key using username and password.
API URL:

[Link]

Parameters:

username : Your account User ID used to login


password : Account password that you use to login

Error Codes
Error Code Meaning

1002 Sender Id/Masking Not Found

1003 API Not Found

1004 SPAM Detected

1005 & 1006 Internal Error

1007 Balance Insufficient

1008 Message is empty

1009 Message Type Not Set (text/unicode)

1010 Invalid User & Password


Error Code Meaning

1011 Invalid User Id

1012 Invalid Number

1013 API limit error

1014 No matching template

1015 SMS Content Validation Fails

1016 IP address not allowed!!

DLR Status Codes


Response Code Status

0, 1 Delivered

6 Absent subscriber for SM

32 Undelivered

31 Subscriber Busy

1 SMS Failed

5 Unidentified subscriber

9 Illegal subscriber

36 SMS Failed

34 System failure

8 SMS Failed

400/456 SMSC Timeout-abort

13 Barred subscriber
Code Examples
PHP - One To Many

php

<?php
function send_sms() {
$url = "[Link]
$data = [
"api_key" => "your_api_key",
"type" => "text",
"contacts" => "88017xxxxxxxx+88018xxxxxxxx",
"senderid" => "sender_id",
"msg" => "your_message",
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);

return $response;
}
?>

PHP - Many To Many

php
<?php
function send_sms() {
$url = "[Link]
$data = [
"api_key" => "your_api_key",
"senderid" => "sender_id",
"messages" => json_encode([
[
"to" => "88017xxxxxxxx",
"message" => "test sms content …"
],
[
"to" => "88018xxxxxxxx",
"message" => "test sms content …"
]
])
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);

return $response;
}
?>

Python - [Link]

python
import [Link]

conn = [Link]("[Link]")
payload = ''
headers = {}
[Link]("GET", "/smsapi?api_key={APIKEY}&type=text&contacts={NUMBER}&senderid={
res = [Link]()
data = [Link]()
print([Link]("utf-8"))

Python - Requests

python

import requests

url = "[Link]
payload = {}
headers = {}
response = [Link]("GET", url, headers=headers, data=payload)
print([Link])

Java - OkHttp

java

OkHttpClient client = new OkHttpClient().newBuilder()


.build();
Request request = new [Link]()
.url("[Link]
.method("GET", null)
.build();
Response response = [Link](request).execute();

C# ([Link] Compatible)

csharp
// Required for Bulk SMS
using RestSharp;
using [Link];

// Variables
string varAPI = "your_api_key";
string varCookie = "";
string varSender = "your_sender_id";

private void SendSMS(string contact, string Msg)


{
// API URL
var client = new RestClient("[Link] + varAPI +
[Link] = -1;
var request = new RestRequest([Link]);
[Link]("Cookie", "'" + varCookie + "'");
IRestResponse response = [Link](request);

// Label for show the sending status


[Link] = ([Link]);
}

Contact Information
Address: Wakil Tower (8th Floor), Ta-131, Gulshan Badda Link Road, Dhaka-1212
Email: info@[Link]
Website: [Link]

For technical support and API approval, please contact MRAM SMS authority.

Common questions

Powered by AI

When sending multiple SMS messages to various contacts using the MRAM SMS API, critical parameters include 'api_key', 'senderid', and 'messages'. The 'messages' parameter should contain an array of objects, each detailing individual mobile numbers and corresponding SMS text. These parameters ensure that multiple messages are correctly routed to the intended recipients .

MRAM SMS API error codes facilitate debugging by providing precise and descriptive feedback on why an API request failed. Each error code corresponds to specific issues, such as 'Sender Id/Masking Not Found' (1002), 'Invalid User & Password' (1010), or 'Balance Insufficient' (1007). By using these codes, developers can quickly identify and rectify problems within the messaging workflow, thereby enhancing efficiency and reducing downtime .

The 'api_key' in the MRAM SMS API is a critical component used for authenticating and authorizing API requests. Users must generate this key by logging into the SMS panel, navigating to the Developers section, and clicking on 'Regenerate Key'. The API Key is a unique identifier that must be approved by MRAM SMS authority to ensure that messages are not denied by the system .

Developers can confirm the SMS API's credit balance by accessing the Credit Balance API. They need to send a request to the API endpoint with their API key to retrieve the current SMS credit available in their account. This ensures that they have sufficient credits before attempting to send messages, thus avoiding errors like 'Balance Insufficient' .

The MRAM SMS API identifies errors related to invalid user credentials using specific error codes. The error code 1010 indicates 'Invalid User & Password', and the error code 1011 signifies 'Invalid User Id'. These error codes notify the user that there is an authentication failure due to incorrect credentials provided in the API request .

To retrieve unread replies from recipients using the MRAM SMS API, developers should utilize the Inbox Reply API. The process involves making a GET request to the API endpoint 'https://msg.mram.com.bd/miscapi/{API_KEY}/getUnreadReplies' with their corresponding API_KEY. This request pulls data about unread SMS replies from recipients .

The 'SMSC Timeout-abort' status code, indicated by the codes 400 or 456, is encountered when there is a timeout issue with the Short Message Service Center (SMSC). This status suggests a failure in communication between the MRAM SMS API and the SMSC, possibly due to network issues, excessive load, or any interruption that prevents timely processing of SMS requests .

The sender ID in the MRAM SMS API is crucial as it identifies the sender to the recipient. It affects message delivery because the sender ID must be pre-approved and provided in the API parameters. An unrecognized or incorrect sender ID could lead to errors such as 'Sender Id/Masking Not Found', thereby preventing the message from being sent .

DLR (Delivery Report) Status Codes are vital for assessing the reliability of communication through the MRAM SMS API. They provide real-time feedback on message delivery status, such as 'Delivered' (0, 1), 'Undelivered' (32), and various failures due to network issues or subscriber availability. This information allows developers to diagnose delivery issues and ensures robust, dependable SMS messaging services .

The MRAM SMS API allows users to schedule SMS messages by using the 'scheduledDateTime' parameter. This optional parameter specifies the date and time for SMS delivery, allowing users to send messages at their preferred time. The API request must include this parameter to enable scheduling .

You might also like