Brain Corporate Bulk SMS

Similar documents
ARTIO SMS Services HTTP API Documentation

text2reach2 SMS API Sep 5, 2013 v1.1 This document describes application interface (API) between SMS service provider (SP) and SMS gateway (SMSGW).

ARTIO VM SMS Documentation

API Integration Guide

To SMS Technical Guide

Connect Media Bulk SMS API Documentation

API Spec Sheet For Version 2.5

API USER GUIDE MARKETING MESSAGES & BROADCASTS

SMS Mobile Termination (MT) API Guide for HTTPS

Integration REST Text2Speech Version 1.1

SMS Submit Interface description HTTP Version 1.5

Redrabbit Cloud-based Communications Platform SMS APIs

GSM V7.0.0 ( )

GSM GSM TECHNICAL March 1996 SPECIFICATION Version 5.1.0

WebADM and OpenOTP are trademarks of RCDevs. All further trademarks are the property of their respective owners.

Response: Note: Please define Dynamic Value in ##Field## The following are the parameters used: For Unicode Message:

API Documentation. Release Version 1 Beta

SMS API User Guide. Document Reference: October Version: 6

version 2.0 HTTPS SMSAPI Specification Version 1.0 It also contains Sample Codes for -.Net - PHP - Java

Sending Documents to Tenstreet API Guide (rev 06/2017)

Stream iphone Sensor Data to Adafruit IO

LINK Mobility SMS REST API MT and Delivery Reports Version 1.3; Last updated September 21, 2017

HTTP API-HELP DOCUMENT

This file contains an excerpt from the character code tables and list of character names for The Unicode Standard, Version 3.0.

3GPP TS V6.1.0 ( )

SMS Gateway. API & Application Technical Documentation. Revision 1. Current as at 10 th August Document ID: DOC-SMS-API-R1

2. On completing your registration you will get a confirmation . Click on the link or paste the link into your browser to validate the account.

API-SMS HTTP/POST Interface Ref Push SMS, Balance, ACKs. April 18, 2017 v2.15

Message parameter details

All requests must be authenticated using the login and password you use to access your account.

ETSI TS V ( ) Technical Specification

ETSI TS V4.2.0 ( )

SortMyBooks API (Application programming

News from the Wrapper

InstaMember USER S GUIDE

Sending Job Requsition Data to Tenstreet API Guide (rev 09/2018)

Secure RESTful Web Services to Mobilize Powerful Website Penetration Testing Tools

API DOCUMENTATION INDODAX.COM

API Spec Sheet For HLR v1.4

SMS HTTP API DOCUMENTATION December 2012

NIC SMS SERVICE INTEGRATION

REMOTE ACCESS TO ANDROID DEVICES. A Project. Presented to the faculty of the Department of Computer Science. California State University, Sacramento

Forthnet Mobile Platform - groupsms http interface v1.0 1 / 9

SMS-Bulk Gateway HTTP interface

API. If you already done integration with Btc-e.com previously, it will be very easy task to use our API.

Remote API V1.1 Documentation

lecture 6 Closures, Networking, CocoaPods

SMS GATEWAY API INTEGRATION GUIDE

Sending Data Updates to Tenstreet API Guide (rev 10/2017)

Trusted Source SSO. Document version 2.3 Last updated: 30/10/2017.

LIPNET OUTBOUND API FORMS DOCUMENTATION

SMS API - Web Services with SSL SHA2 HMAC Version 1.7

r v i e w o f s o m e r e c e n t d e v e l o p m

Wired 2 Wireless Technology Solutions API Help Document Copyright Introduction. 2. Parameter list

LAMPIRAN. byte bcdtodec(byte val) { return( (val/16*10) + (val%16) ); } void setup() {

HTTPS API Specifications

You 2 Software

API-SMS HTTP/GET Interface Ref Push SMS, Balance, ACKs. April 18, 2017 v1.12

Backup Gateway Documentation

Lecture 5 C Programming Language

Integrating with Cellsynt's SMS gateway via HTTP interface (technical documentation)

SMS Aggregation - API Documentation

ArcGIS for Server Administration API for C# Developers. Philip

API LEADFOX TECHNOLOGY INC. By Sébastien Lamanna. Created on January 6, 2016

Click 2 Call. All rights reserved to Voicenter Revision

SMS Relay. API Documentation SPLIO - SPRING Contact and Campaign SMS Relay API - EN v1.2.docx

TECHNICAL GUIDE SSO JWT. At 360Learning, we don t make promises about technical solutions, we make commitments.

PJ-600 Series Printer ESC/P Command Reference

Quenbec inc # henri bourassa H3L-3N3 Montreal, QC,Canada Toll free: Mobile

Communication and processing of text in the Kildin Sámi, Komi, and Nenets, and Russian languages.

Way2mint SMS Mobile Terminate (MT) API Guide for HTTP / HTTPS

API HTTP TECHNICAL DOCUMENTATION WEB-BASED SMS SENDING PLATFORM. Version Update: July 12th Mobile Marketing and Messaging Solutions

Service Segment Version 3

UTF and Turkish. İstinye University. Representing Text

Terry Carl Walker 1739 East Palm Lane Phoenix, AZ United States

ONE SOCIAL. A Writing Project. Presented to. The Faculty of the Department of Computer Science. San José State University

WhatsATool API - REST-Like Interface to WhatsATool Services

API Specification Doc

One station Impact Printer. Model: WP-300 Version : 1.03

Representing Characters and Text

KIWIRE 2.0 API Documentation. Version (February 2017)

SharePoint Wiki Plus Getting Started

Sending Application Data to Tenstreet API Guide

Communication and processing of text in the Chuvash, Erzya Mordvin, Komi, Hill Mari, Meadow Mari, Moksha Mordvin, Russian, and Udmurt languages.

SMS Outbound. HTTP interface - v1.1

HTTP Specification Version 1.83

The Merit Palk API allows 3rd party developers to expand and build on the Merit Palk platform.

RouteMobile Mobile Client Manual for Android Version: 2.0

Revision: 50 Revision Date: :43 Author: Oliver Zabel. GTX Mobile Messaging SMS Gateway Interface Simple HTTP API Manual

HappyFox API Technical Reference

Android Volley Tutorial

Quick Answers. You may create any Sender ID for the transactional route, provided the Sender ID should be of 6 alpha characters only.

Introduction. Copyright 2018, Itesco AB.

Errors Message Bad Authentication Data Code 215 User_timeline

Character Entity References in HTML 4 and XHTML 1.0

Entity Configuration Configure the account entity in D365 with fields to hold the cloud agreement status. Two Value OptionSet

HTTP API. Table of Contents

Requirement Document v1.1 WELCOME TO CANLOG.IN. API Help Document. Version SMS Integration Document

Bulk HTTP API Specification

SMS API TECHNICAL SPECIFICATION

Transcription:

Brain Corporate Bulk SMS W e S i m p l y D e l i v e r! API Documentation V.2.0 F e b r u a r y 2 0 1 9

2 Table of Contents Sending a Quick Message... 3 API Description... 3 Request Parameter... 4 API Response... 4 Request Codes... 5 Message Count Method... 5 7-bit Encoding... 5 Unicode Encoding... 6 Multipart SMS... 6 Sample Codes... 7 Android Sample Code... 7 Node.js Sample Code... 8 SWIFT Sample Code... 8.NET Sample Code... 9 Python Sample Code... 11 PHP Sample Code... 11

3 Sending a Quick Message In order to deliver a message, the system needs to authenticate the request as coming from a valid source thus the valid credentials are mandatory. This command is used to send a Quick Message. API Description To request for on, the Service Provider s web server should make an Http request to BSMS API s server written below: https://cp.bsms.pk/api/quick/message HTTP METHODS: GET / POST Request parameters To send a quick message, the destination address should be in the format 923xxxxxxxxx (12 digits). The basic parameters required are listed: Parameters are not case sensitive.

4 Parameter Type Description Value (Sample) username String A valid account ID Username password String A valid password of ID Secret mask String The mask to be used to send message BrainTEL to Integer A valid mobile number 923123456789 message String Text message to be sent Message Content lang (optional) String Supported languages English (en) or Urdu (ur) en unicode (optional) Boolean To send message in URDU, parameter must be TRUE False channel (optional) String Use any value to filter out the message by departments or any filter accounts Return Response Each message returns a JSON encoded string after each post with a unique identifier in the form of Transaction ID, status code and response. The message ID can be used to track and monitor any sent message. When submitting a request to BSMS API s server, the SP s web server will receive back the following JSON response (for example): "Status":"OK","Transactional ID":17194330,"Response":"Sent Successfully"

5 Request Response Codes Code Response Description 200 Sent Successfully Message is successfully sent to recipient 401 Invalid Credentials The credentials you are using are invalid 401 Your BSMS API is disabled Your BSMS API is disabled by Admin 203 Invalid Mask You are using invalid/unasigned mask 203 Insufficient Balance Your bucket has been expired/consumed 413 Message is too large The message you are sending is too large. Message Count 7-bit encoding This is the most commonly used encoding for messages with GSM 03.38 character set. In this 7- bit alphabet you can use only following characters: @ Δ SP 0 P p _! 1 A Q a q $ Φ " 2 B R b r Γ # 3 C S c s è Λ 4 D T d t é Ω % 5 E U eu ù Π & 6 F V f v ì Ψ ' 7 G W g w ò Σ ( 8 H X h x Ç Θ ) 9 I Y i y LF Ξ * : J Z j z Ø ES C + ; K Äk ä ø Æ, < L Ö l ö CR æ - = M Ñ m ñ Å ß. > N Ü n ü å É /? O o à There are also some characters in the GSM 03.38 Extension Table that can be used for the cost of two characters by prepending escape character ESC (0x1B): ^ [ ] ~ The message length for 7bit encoding is up to 160 characters.

6 Unicode Encoding Unicode (UCS-2) encoding supports a great range of characters and languages compared to the very limited alphabet of 7bit encoding. If your message contains any characters not listed in the 7-bit alphabet, UCS-2 encoding is automatically used. In this case, each message takes up a lot more space, thus the message length is reduced to 70 characters. Multipart SMS messages When the message length exceeds the SMS character limit of 160 characters in case of 7bit encoding (or 70 characters for UCS-2 encoding), the message is split up to multiple separate SMS and sent to the handset separately as well. So, it's important to use this calculator to make sure that you don't exceed the limit and pay more than you planned. To be able to concentrate the messages on the phone, special header (UDH) is set for each message, which states the order and message each part belongs to. Due to this special UDH, the length of each combined 7-bit message is shortened to 153 characters (67 characters for UCS-2). Type Regular SMS Multipart SMS 7-bit 160 chars 153 chars Unicode 70 chars 67 chars

7 Sample Codes Android Sample StringRequest registerrequest = new StringRequest(Request.Method.POST, "https://cp.bsms.pk/api/quick/message", new Response.Listener<String>() @Override public void onresponse(string response) pdialog.dismiss(); try JSONObject object = new JSONObject(response); Log.d("Response from API", "onresponse: " + response); catch (JSONException e) e.printstacktrace();, new Response.ErrorListener() @Override public void onerrorresponse(volleyerror error) new VolleyErrorManager(error, mcontext,"exception: "); ) @Override protected Map<String, String> getparams() Map<String, String> params = new HashMap<String, String>(); params.put("user", "username"); params.put("password", "secret"); params.put("to", "923123456789"); params.put("mask", "BrainTEL"); params.put("message", "Your message"); ; return params;

8 Node.js Sample var Request = require("request"); Request.post( "headers": "content-type": "application/json", "url": "https://cp.bsms.pk/api/quick/message", "body": JSON.stringify( "user": "username", "password": "secret", "to": "923123456789", "mask": "BrainTEL", "message": "Your message" ), (error, response, body) => if(error) return console.dir(error); console.dir(json.parse(body)); ); SWIFT Sample let params = ["user": "username", "password": "secret", "to": "923123456789", "mask": "BrainTEL", "message": "Your message"] as Dictionary<String, String> var request = URLRequest(url: URL(string: "https://cp.bsms.pk/api/quick/message")!) request.httpmethod = "POST" request.httpbody = try? JSONSerialization.data(withJSONObject: params, options: []) request.addvalue("application/json", forhttpheaderfield: "Content-Type") let session = URLSession.shared let task = session.datatask(with: request, completionhandler: data, response, error -> Void in do let json = try JSONSerialization.jsonObject(with: data!) as! Dictionary<String, AnyObject> print(json) catch print("error") ) task.resume() =

9.Net Sample using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; namespace HttpClientSample public class Message public string user get; set; public string password get; set; public int to get; set; public string mask get; set; public string message get; set; class Program static HttpClient client = new HttpClient(); static async Task<Uri> CreateMessageAsync(Message message) HttpResponseMessage response = await client.postasjsonasync( "api/quick/message", message); response.ensuresuccessstatuscode(); return response.headers.location; static async Task<Message> SendMessageAsync(string path) Message message = null; HttpResponseMessage response = await client.getasync(path); if (response.issuccessstatuscode) message = await response.content.readasstringasync(); return message;

10 static void Main() RunAsync().GetAwaiter().GetResult(); static async Task RunAsync() client.baseaddress = new Uri("https://cp.bsms.pk/"); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add( new MediaTypeWithQualityHeaderValue("application/json")); try Message message = new Message user = "username", password = "secret", to = "923123456789", mask = "BrainTEL", message = "Your Message" ; var url = await CreateMessageAsync(message); Console.WriteLine($"Created at url"); message = await GetProductAsync(url.PathAndQuery); Console.WriteLine(message); catch (Exception e) Console.WriteLine(e.Message); Console.ReadLine();

11 Python Sample import requests payload = 'user': 'username', 'password': 'secret', 'to': '923123456789', 'mask': 'BrainTEL', 'message': 'Your message' r = requests.get('https://cp.bsms.pk/api/quick/message', params=payload) r.text PHP Sample function httppost($url,$params) $postdata = ''; foreach($params as $k => $v) $postdata.= $k. '='.$v.'&'; $postdata = rtrim($postdata, '&'); $ch = curl_init(); curl_setopt($ch,curlopt_url,$url); curl_setopt($ch,curlopt_returntransfer,true); curl_setopt($ch,curlopt_header, false); curl_setopt($ch, CURLOPT_POST, count($postdata)); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $output = curl_exec($ch); curl_close($ch); return $output; $url = "https://cp.bsms.pk/api/quick/message"; $params = [ "user" => "username", "password" => "password", "mask" => "BrainTEL", "to" => "923123456789", "message" => "Your Message", ]; httppost($url,$params);