JAVA-HLR

By
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/hlr");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);

List<NameValuePair> params = new ArrayList<NameValuePair>(1);
params.add(new BasicNameValuePair("mobilenumber", "0870000000"));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

Read more

JAVA IMPORT

By
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/END_POINT");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);

Read more

JAVA VERIFY CODE

By
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/verify");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);

List<NameValuePair> params = new ArrayList<NameValuePair>(2);
params.add(new BasicNameValuePair("code", "2FA_CODE"));
params.add(new BasicNameValuePair("recipient", "0870000000"));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

Read more

JAVA VERIFY SEND

By
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/verify");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);

String json = "{\"messagetext\" : \"Hello World\", \"recipient\" : \"0870000000\"}";
List<NameValuePair> params = new ArrayList<NameValuePair>(1);
params.add(new BasicNameValuePair("message", json));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

Read more

JAVA IMPORT

By
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/import");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);

String json = "{\"firstname\" : \"Hello\", \"mobilenumber\" : \"0870000000\"}";
List<NameValuePair> params = new ArrayList<NameValuePair>(1);
params.add(new BasicNameValuePair("importdata", json));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));

HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

Read more

JAVA CREDITS

By
URL url = new URL("http://rest.sendmode.com/v2/credits?access_key=YOUR_ACCESS_KEY");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");

BufferedReader in = new BufferedReader(
  new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    content.append(inputLine);
}
in.close();
con.disconnect();

Read more