السودان - الخرطوم - العمارات - شارع 41 - برج فلاي ناس
+249123325566
sales@mazinhost.com

SMS API DOC

 SMS API

Send SMS in WordPress

Send SMS in WordPress, Quick integration with Brqsms gateway API.

Download plugin from here https://github.com/adammazin/wp-sms

On GitHub click on “Code” then “Download ZIP” and go to your WordPress Website and add new plugin “upload plugin”.

After installation go to plugin “WP SMS or الرسائل النصية” -> settings -> gateway -> then select brqsms.com.

Use your credential and remember to fill ” API username and Sender Number” with your approved “Sender ID

Send SMS in PHP

Send SMS in PHP Projects, Quick integration with Brqsms gateway API.

$curl = curl_init();

$from = "Sender_ID";
$to = "249123325566";
$message = "Salam from Brqsms API";

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://mazinhost.com/smsv1/sms/api",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "action=send-sms&api_key=YkN0000tUE1qY0J4Y0Z1em5Jemw=&to=$to&from=$from&sms=$message",
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Send SMS in C#

Send SMS in C# Projects, Quick integration with Brqsms gateway API.

private async Task GetAPIReponse()
{
  Dictionary<string, string=""> fields = new Dictionary<string, string="">();
  fields.Add("action", "send-sms");
  fields.Add("api_key", "YkNEdkNtUE1qY0J4Y0Z1em5Jemw");
  fields.Add("from", "Sender_ID");
  fields.Add("to", "249912325566");
  fields.Add("sms", "Salam from Brqsms API");
  fields.Add("Unicode", "0");
  var serializer = new JavaScriptSerializer();
  var serializedResult = serializer.Serialize(fields);
  var data = new StringContent(serializedResult, Encoding.UTF8, "application/json");

  var httpclient = new HttpClient();
  httpclient.DefaultRequestHeaders.Add("", "");
  var response = await httpclient.PostAsync("https://mazinhost.com/smsv1/sms/api", data);
  string page = response.Content.ReadAsStringAsync().Result;

  return page;
}</string,></string,>

Send SMS in Python

Send SMS in Python Projects, Quick integration with Brqsms gateway API.

import http.client
import mimetypes

conn = http.client.HTTPSConnection("mazinhost.com/smsv1/sms/api")
payload = 'action=send-sms&api_key=YkNEdkNtUE1qY0J4Y0Z1em5Jemw=&from=Sender_ID&to=249123325566&sms=Salam from Brqsms API'
headers = {
  '': ''
}
conn.request("POST", "/v2/message", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Parameter Type Description
api_key

Required
string Unique Key use for Authentication and you can generate it on API Page
Parameter Type Description
from

Required
string Sender (from) to send the message Ex. Brqsms
Sender ID must be registered in your account. You can register your company name as Sender ID from New Sender form in the dashboard
to

Required
mobile number Format mobile number without a + and a country code, (E.249format). e.g, a Sudan number would have the format 24199123325566. A KSA number would have the format 96650000000.
sms

Required
string Your Message text. Each SMS message can hold a maximum of 160 characters including spaces, if you there is Arabic characters can hold a maximum of 70 characters including spaces, the maximum number of characters you can write down is 800 (around 5 SMS).
unicode

Required
int if your text contain symbols or Arabic characters then should be equal 1.

Response

Ultimate SMS API return response with json format, like:

{"code":"ok","message":"Successfully Send"}
Status Message
ok Successfully Send
100 Bad gateway requested
101 Wrong action
102 Authentication failed
103 Invalid phone number
104 Phone coverage not active
105 Insufficient balance
106 Invalid Sender ID
107 Invalid SMS Type
108 SMS Gateway not active
109 Invalid Schedule Time
110 Media url required
111 SMS contain spam word. Wait for approval

Schedule SMS

$schedule_date = '09/17/2018 10:20 AM'; //Date like this format: m/d/Y h:i A

Unicode SMS

$unicode  = '1'; //For Unicode message

the number we are sending to – Any phone number

$destination = '249123325566';

For multiple number please use Comma (,) after every single number.

$destination = '2491230000000,2491232000000,249123320000,249123325566';