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
Parameter | Type | Description | Mandatory |
---|---|---|---|
username | String | Enter your user name | Yes |
password | String | Enter your password | Yes |
src | String | This is the originating address. Numeric or alpha-numeric values are allowed | Yes |
dst | String | This is the destination address. Only numeric values are allowe | Yes |
msg | String | SMS message content. For single message sending API, only text data is allowed | Yes |
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();
}
}