Documentation

Here you can find sample code to implement our API.


import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
public class SendSms{
    public static void main(String[] args)
    {
    //Prepare Url
            URLConnection myURLConnection=null;
            URL myURL=null;
            BufferedReader reader=null;
    //Send SMS API
            String mainUrl="You can find http API url from http://indianrailapi.com/IndianRail/API";
    
    try
    {
    //prepare connection
                myURL = new URL(mainUrl);
                myURLConnection = myURL.openConnection();
                myURLConnection.connect();
                reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream()));
    //reading response
                String response;
    while ((response = reader.readLine()) != null)
    //print response
                System.out.println(response);
    //finally close connection
                reader.close();
    }
    catch (IOException e)
    {
                    e.printStackTrace();
    }
    }
}
Contributed By : Ashutosh Gupta
Note: If you are too beginner in development, you can use our services in Rs. 500.(Only for paid users.) (C#.Net, VB.Net, JQuery, AngularJS Only.)
Developers are requested to contact at admin@indianrailapi.com with sample code to become support members. Sample code must be uploaded in github, google drive and so on.