textware Logo

Single API

API Details

Base URL
https://textware.lk/send_sms.php.
HTTP Method
GET
Request Format
Query Params
Success Response Code
200 OK
Request Parameters
ParameterTypeDescriptionMandatory
usernameStringEnter your user nameYes
passwordStringEnter your passwordYes
srcStringThis is the originating address. Numeric or alpha-numeric values are allowedYes
dstStringThis is the destination address. Only numeric values are alloweYes
msgStringSMS message content. For single message sending API, only text data is allowedYes

Example Implementation

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) throws IOException {
        String url = "https://textware.lk/send_sms.php.?username=YOUR_USERNAME&password=YOUR_PASSWORD&src=YOUR_SRC&dst=DESTINATION_NUMBER&msg=Your+test+message&dr=1";
        HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();
        con.setRequestMethod("GET");
        int status = con.getResponseCode();
        System.out.println("Response Code: " + status);
        con.disconnect();
    }
}
BestWeb.lk Award Badge