NIC SMS Gateway Integration Guide
NIC SMS Gateway Integration Guide
Contents
Step 1: Registration for SMS Service ........................................................................ 3
Step 2: Pre-requisite for integration and checking ...................................................... 3
Step 3: Testing ..................................................................................................... 5
Step 4: Sample code for integration over HTTPS........................................................6
Step 1: Registration for SMS Service
1. ALL TESTING MUST BE DONE FROM SERVER FROM WHICH SMS GATEWAY NEEDS
TO BE INTEGRATED.
2. Check the domain look up using nslookup command. If domain
(smsgw.sms.gov.in) does not get resolved, then please contact your
server/firewall administrator. Refer below screenshot for using nslookup command.
5. One possible reason for telnet failure is that your application server is behind a
firewall and firewall rule is not configured to allow traffic from your server to SMS
Gateway.
6. In this regard you have to apply for firewall rule through https://farps.nic.in as per
below screenshot.
7. Firewall request has to be filled by respective NIC coordinator for SMS access
through URL https://farps.nic.in/ as described below in Sample Firewall request.
*If both private IP and public IP are configured on your application server, then before
filling up the following firewall form, please confirm from your network/firewall
administrator that the SMS request from your application will reach SMS server from
which IP (PUBLIC or PRIVATE).
Are you the Server/ Website/
NO
Application Owner ?
Public IP rule for access from Outside Systems to SMS Gateway Server
URL of the
Reason for
From To Services server to be Ports Protocol
opening port
visited
YOUR
APPLICATION 164.100.14.211 HTTPS 443 SMS Service TCP
SERVER IP
For any issue related to firewall, NIC Cyber Security team should be contact on 011-
24305140 (Email on : [email protected], [email protected] , [email protected]).
Step 3: Testing
1. Once again test connectivity using nslookp and telnet command as explained
above.
2. Secondly test SMS delivery by calling SMS API (https://
smsgw.sms.gov.in/failsafe/HttpLink?ussername=[USERNAME]&pin=[PASSWORD]&messa
ge=[MESSAGE]&mnumber=[MOBILE NUMBER]&signature=[SENDER ID]) from the same
server/machine for which you have the firewall permission. All testing must be
done from the same eco-system for which you have got the firewall rule enabled.
If this is not done you may get different result and SMS team will not be
responsible for the same. If it is windows environment, then launch the internet
browser and copy the SMS API on the browser as mentioned above. For Linux
based system use wget or elinks command.
Use wget and elinks command as shown below (for Linux based system).
3. If error reported as shown in below image, then contact SMS Support team on
[email protected].
4. If SMS delivery is successful, then test SMS from your application. If from
application SMS is not getting delivered or you are facing any issues then check
and debug your application.