What types of RCS messages for your company?Read the article What kind of RCS messages for your company?More information What kind of RCS messages for your company?More information Quali tipi di messaggi RCS per la vostra azienda?Ulteriori informazioni Welche Arten von RCS-Meldungen für Ihr Unternehmen?Mehr Informationen

Implement SMS in your Java development environment

Implement SMS in your Java development environment. Thanks to the API SMSall the functionalities of our SMS platform are at your fingertips. From sending and receiving messages, to OTP authentication and the creation of advanced customer relationship scenarios. Follow the Getting Started guide SMS Java to add SMS to your Web application.

Send SMS Java in detail

Quick and easy API integration

Compatible with all programming languages, the requests (GET, POST...) detailed in the comprehensive documentation documentation for quick and easy integration of our API.

Maximum safety

Hosted in 2 level 4 data centers in France, our APIs SMS guarantee business continuity. Our platform is ISO 27001 and ISO 27701 certified. 

Continuous service

Our dedicated, high-availability infrastructure is continuously monitored 24/7/365, with fail-safe and redundant servers.

Technical support at your service

All our teams (support and developers) are available to help you integrate our APIs in Java, or to answer any questions you may have about the day-to-day use of the SMS API.

TO FIND OUT MORE
Subscription formulas for ultra-competitive rates
subscription form

STARTER GUIDE

Start sending SMS with Java

Create a gateway between your application and our platform SMS with Java requests to send SMS (mass or individual), receive SMS, personalize the sender, manage unsubscriptions/STOPs, etc.

Deploy the sending of your first SMS with this sample source code ↓


import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.util.EncodingUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;
 
/**
* Parameters:
*
* - accessToken (required)
* - message (required)
* - destinataires (required): Receivers separated by a comma
* - emetteur (optional): Allows to deal with the sms sender
* - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
* - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/
 
public class ExempleClientHttpAPI {
 
 private static final String URL = "https://api.smsmode.com/http/1.6/";
 private static final String PATH_SEND_SMS = "sendSMS.do";
 private static final String PATH_SEND_SMS_BATCH = "sendSMSBatch.do";
 private static final String ERROR_FILE = "The specified file does not exist";
 
 // send SMS with GET method
 public String sendSmsGet(String accessToken, String message, String destinataires, String emetteur, String optionStop) throws IOException {
 
 HttpClient httpClient = new HttpClient();
 String finalUrl = URL + PATH_SEND_SMS;
 GetMethod httpMethod = new GetMethod(finalUrl);
 httpMethod.addRequestHeader("Content-Type", "plain/text; charset=ISO-8859-15");
 
 NameValuePair[] params = {
 new NameValuePair("accessToken", accessToken),
 new NameValuePair("message", message),
 new NameValuePair("numero", destinataires),
 new NameValuePair("emetteur", emetteur),
 new NameValuePair("stop", optionStop)
 };
 
 httpMethod.setQueryString(EncodingUtil.formUrlEncode(params, "ISO-8859-15"));
 httpClient.executeMethod(httpMethod);
 return convertToString(httpMethod.getResponseBodyAsStream()); 
 }
 
 // send SMS with POST method
 public String sendSmsPost(String accessToken, String message, String destinataires, String emetteur, String optionStop) throws IOException {
 HttpClient httpClient = new HttpClient();
 String finalUrl = URL + PATH_SEND_SMS;
 PostMethod httpMethod = new PostMethod(finalUrl);
 httpMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-15");
 
 NameValuePair[] params = {
 new NameValuePair("accessToken", accessToken),
 new NameValuePair("message", message),
 new NameValuePair("numero", destinataires),
 new NameValuePair("emetteur", emetteur),
 new NameValuePair("stop", optionStop)
 };
 
 httpMethod.setRequestBody(params);
 httpClient.executeMethod(httpMethod);
 return convertToString(httpMethod.getResponseBodyAsStream());
 }
 
 // send SMS with POST method (Batch)
 public String sendSmsBatch(String accessToken, String batchFilePath, String optionStop) throws IOException {
 File file = new File(batchFilePath);
 if (!file.exists())
 return ERROR_FILE;
 
 HttpClient httpClient = new HttpClient();
 String finalUrl = URL + PATH_SEND_SMS_BATCH + "?accessToken=" + accessToken + "&stop=" + optionStop;
 PostMethod httpMethod = new PostMethod(finalUrl);
 
 Part[] parts = new Part[1];
 parts[0] = new FilePart(file.getName(), file, "text/csv", null);
 
 httpMethod.setRequestEntity(new MultipartRequestEntity(parts, httpMethod.getParams()));
 httpClient.executeMethod(httpMethod);
 return convertToString(httpMethod.getResponseBodyAsStream());
 }
 
 private String convertToString(InputStream stream) {
 Scanner sc = new Scanner(stream);
 StringBuilder sb = new StringBuilder();
 while(sc.hasNext()){
 sb.append(sc.nextLine());
 }
 return sb.toString();
 }
}

Compatible with the most common programming languages (PHP, Java, ASP, C++, Ruby, WINDEV, Curl, etc.), the SMS HTTP API is open source. However, for greater satiability, security and functionality, the REST smsmode© is preferable. CURLs allow you to configure the sending and receiving of SMS and to manage your entire customer account (contact file, available credits, programming of sending date and time, consultation of reception status, personalization of sender, etc.).

Why choose our webservice SMS ?

Our SMS mailing service offers you all the features you need for your campaigns, SMS marketingnotification or SMS OTP. Our SMS gateway is accessible via our API SMS or a SaaS customer space.

Routing to MVMOs on the best routes

As an ARCEP telecom operator, we only transmit SMS via high-quality routes (excluding roaming). We guarantee maximum quality and deliverability.

Real-time monitoring of our SMS service

Our Gateway SMS is continuously monitored. Sending performance SMS is optimized for the different channels used (notification, marketing or OTP). Detailed statistics are available in the customer area.

Secure, high-availability infrastructure

Millions of requests are processed daily by our SMS platform. HTTP protocols and SSL certificates guarantee a high level of security, while configurable data encryption ensures maximum confidentiality.

REPORT
Digital security at smsmode© ?
Discover our data protection and privacy measures designed with RGPD compliance in mind.
safety report smsmode

Create your free account

Try out our SMS platform and benefit from 20 free test credits, with no obligation.

Need more info?
We look forward to hearing from you.