Transactional SMS API

What is API and how it will work?

API (Application Programming Interface) allows you to integrate ZNI SMS services into your own application for better control and functionality required by you. For example you are using Oracle (as a backend to keep your data) and want to send SMS to all of your customers who have joined you after 1st of May 2009. There are two ways to perform this task either you run a query and then upload all the data on our server and then send or else you can use our API to push the SMS directly from your own application.

We have platform independent APIs therefore you can use them with any OS and on any programming language like ASP, ASP.NET, PHP, JSP, Ruby on Rails etc. Currently we support single SMS API (HTTP API based on REST), Group SMS API (XML API).

Our XML SMS API supports two methods One to Many and Many to Many. Please download the API documentation (PDF format) to check the implementation guide and methods supported.

HTTP API:  This API is used to send single SMS from your application. It’s just an URL which you should call to send SMS.

XML API: This API is best suited for sending SMS in masses e.g. you have a messages which you want to send to 1000 people i.e. same message to multiple recipients, in this case you can use this API.

Dynamic XML API: Many times you need to send customized SMS i.e. different numbers, different messages in masses. This API is best suited for this kind of situations.

Balance Check API: Use this API to check the balance of your account any time with expiry date.

Delivery Report API: This API shall be used to check the delivery status of your SMS (if, supported by your plan).

You can download the API document from here

Toll Free Numbers Developer API

Now manage your toll-free numbers or build your own web GUI with our extensive APIs. Lot of API calls are available to manage calls, call flow, IVR and features. Few Examples are:

Call To URL

This API is used to get the Caller Information on the CRM so that caller ID based information can be retrieved.

Type: Push
Method: GET
Push Time: Queued
URL Format: http://yourdomain.com/script.php

Parameters:

calledby: Phone number of the caller

Response Requested: N/A

Forwarding API

This API is used to return dynamic call forwarding numbers based on the caller ID. Maximum of 3 phone numbers can be returned.

Type: Push
Method: GET
Push Time: Real
URL Format: http://yourdomain.com/script.php

Parameters:

calledby: Phone number of the caller

Response Requested: 11-digit phone number (including 0) in comma separated values

Billing API

This API is pushed after the call has been completed.

Type: Push
Method: GET
Push Time: Queued
URL Format: http://yourdomain.com/script.php

Parameters:

calledby: Phone number of the caller
calledto: Destination phone number on, which call was forwarded
duration: Call duration in seconds
callstatus: Answered, Rejected, Busy, Congestion, OnIVR, Cancelled etc.
callcharges: Amount in rupees you have been charged for this call
smssent: Number of SMS sent as alerts through our system

Response Requested: N/A

Selective Call Forwarding

This API is used to return dynamic call forwarding status for the callerid. You can choose whether to forward call or disconnect the call after IVR.

Type: Push
Method: GET
Push Time: Real
URL Format: http://yourdomain.com/script.php
Parameters:
calledby: Phone number of the caller
Response Requested: True or False

Pull Based APIs

Type: Pull
Method: GET

URL Format: http://mis.ziffy.in/api/apiprocess.asp?userid={MASTER_ID}&apikey={API_KEY}&cbsno={INTERNAL_NUMBER}&action={PREDEFINED_ACTIONS}&{EXTRA_PARAMETERS}

Parameters:

userid : Your corporate ID
apikey : 32bit API key, You can get this by creating a support request.
cbsno : Your internal number, this number is available on your panel.
action : Following action commands are available

  • addWhiteList : Allows you to add a whitelist number

    • Extra Parameters:

      • no = The number, which you want to add

  • removeWhiteList : Allows you to remove a whitelist number

    • Extra Parameters:

      • no = The number, which you want to remove

  • addBlackList : Allows you to add a blacklist number

    • Extra Parameters:

      • no = The number, which you want to add

  • removeBlackList : Allows you to remove a blacklist number

    • Extra Parameters:

      • no = The number, which you want to remove

  • enableDND : Allows you to set DND. If enabled call forwarding after IVR will be disabled.

  • disableDND : Disables the DND if, set.

  • changeAnnouncement : This will enable a small audio prompt before the IVR.

    • Extra Parameters:

      • audioid = Audio file ID, which you want to set as announcement

  • disableAnnouncement : Disable the announcement you have previously set.

  • enableHolidayMode : All incoming calls will be rejected.

  • disableHolidayMode : Incoming calls will be accepted as usual.

 

  • changeIVR : Allows you to change whole IVR.

    • Extra Parameters:

      • ivrid = IVR id, which you want to enable.

  • changeDefaultRoutingNumber : Default routing number can be changed through this API call and this will only work if IVR is not set.

    • Extra Parameters:

      • no = 10 digit phone number without ISD code or 0.

  • changeMCIVR : Allows you to change whole IVR.

    • Extra Parameters:

      • audioid = Audio id, which you want to enable.

  • listAudioFile : This will display a list of audio files you have uploaded in the system. The list will be in comma separated format contains audio file id and file name.

    • Parameters returned:

      • audioid = File id, required in case of setting announcement

      • filename = Name of the file

  • listIVRS : This will display a list of IVRs you have created in the system. The list will be in comma separated format contains ivr file id and ivr name and ivr status.

    • Parameters returned:

      • ivrid = IVR id, required in case of IVR

      • ivrname = Name of the IVR

      • ivrstatus = Active or Inactive

Kindly note:

Real Time push APIs like Forwarding, Selective Forwarding are time sensitive APIs i.e. if your server did not respond within 10 seconds it will play the IVR and drop the connection of the caller. Please ensure your server responds in timely fashion always.

Queue based APIs like Billing or Call-To-URL keeps a queue of the data and sends the data one by one and are more fault tolerant but lags in response time.

For pull based APIs you are allowed 200 requests per day from a single userid and 500 requests per day from a particular IP address. Also if your IP fails to authenticate for more than 5 times in a day than it will be banned for next 24 hours.

API Key can be requested from here. API key is password independent i.e. you can change your password as many times as you want and it will not affect the API key.

Send SMS from ASP, .NET, PHP, RUBY, PYTHON, JAVA, JQUERY

With ZNI’s Android App (http://znisms.com/blog/?p=323) you can use your mobile to send SMS with any programming language like ASP, .NET, PHP, RUBY, JAVA etc. using our Android SMS gateway APIs.

API for Sending SMS

http://api.znisms.com/post/mobilesms.asp?userid=XXXXXXXX&apikey=APIKEY&sendto=XXXXXXXXXX&message=ZNI%20IS%20BEST&device=name

Parameters: 

userid: ID created on ZNISMS.com
apikey: 32bit API Key (provided by ZNI)
sendto: Mobile number on which message has to be sent.
message: URL encoded message. Max 160 characters.
device: Device name as provided in settings page.

You can keep pushing SMS through API even when your mobile is offline and once it comes online our Application will push all data through your mobile.

Our REST API is platform independent.

We are more than a SMS aggregator… we are developers at core

One of my old customer called me asked what we are doing other than selling SMS, as it is a very competitive industry and could die very soon and I replied actually we are not selling SMS, we provide a platform to the developers.

This makes one thing clear in my mind that my customers even those who are having a relationship with ZNI with over 7 years still thinks we are just a SMS vendor and they never realized (or should I say we failed to communicate them that) we are more than a SMS aggregator.

How?

Our developer platform is very scalable and provide our developers cloud resources which they can scale up and down as per their requirement. But what are the services, which we are providing and others don’t?

To start with the most obvious we have,

1. SMS API Which allows developers to send SMS on any mobile number in India 24×7 via a simple URL push or XML based advance API.

2. DND API Since the day TRAI implements the NCCPR 2010, we allowed our associates and developers to check the NCCPR data in real time via API so that they can inform their clients beforehand about non-delivery of SMS maintaining a good reputation.

3. IVRS API Yes, very few have idea that they can use our Toll Free service with an IVRS API to control the flow of a call like informing the caller about their due balance after checking the status from a database.

4. Missed Call API Want to capture number of calls received on a telephone line while you were not there? You can use our REST based MC APIs. We use that on every holiday to let us our callers know about the holiday without spending a dime.

5. SMS Short Code API Developers looking to receive customer responses via SMS can use our SMS Short Code API for the same and can receive the responses on their applications in real time.

6, Long Code API & Software Long code is nothing but a mobile number and many vendors charging upto Rs 10,000 per month for the service but we at ZNI has launched an Android application which will turn your normal android phone into a long code gateway and its absolutely free.

If, you are starting up a mobile or SMS based service and looking for specific APIs do let me know on tushar@zni.co.in

I always try to simplify things as much as possible for new entrants so, that they don’t have to face all the difficulties which I have already faced in early days of my venture.