Vous souhaitez développer une application en JAVA qui permet d'envoyer des SMS ? Consultez nos exemples de codes pour chacune des fonctionnalités disponibles depuis notre API SMS.

				      			import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Sendmessage {
								
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/message/send");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);
											nameValuePairs.add(new BasicNameValuePair("text","Nouveau message via l'API d'Envoyer SMS Pro depuis un script JAVA"));
											nameValuePairs.add(new BasicNameValuePair("recipients","33600000000"));
											nameValuePairs.add(new BasicNameValuePair("sendername","Societe"));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Message envoyé");
												System.out.println("Votre messageid : "+doc.getElementsByTagName("message_id").item(0).getTextContent());
												System.out.println("Nombre de SMS envoyé : "+doc.getElementsByTagName("sms_sent").item(0).getTextContent());
												System.out.println("Nombre de SMS restant : "+doc.getElementsByTagName("sms_remaining").item(0).getTextContent());
											}
											else
											{
												System.out.println("Le message n'a pas été envoyé :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Getmessagestatistics {
								
									
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/message/stats");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
											nameValuePairs.add(new BasicNameValuePair("messageid",""));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Les stats du message");
												System.out.println("Nombre de SMS reçu : "+doc.getElementsByTagName("number_status_1").item(0).getTextContent());
												System.out.println("Nombre de SMS non délivré : "+doc.getElementsByTagName("number_status_2").item(0).getTextContent());
												System.out.println("Nombre de SMS en attente chez l'opérateur : "+doc.getElementsByTagName("number_status_3").item(0).getTextContent());
												System.out.println("Nombre de SMS en cours de traitement : "+doc.getElementsByTagName("number_status_4").item(0).getTextContent());
												System.out.println("Nombre de STOP SMS : "+doc.getElementsByTagName("number_status_5").item(0).getTextContent());
												
												NodeList nList=doc.getElementsByTagName("recipient");
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(" ");
													NodeList currentNList = nList.item(i).getChildNodes();
													System.out.print("Le numéro "+currentNList.item(0).getTextContent());
													switch(Integer.parseInt(currentNList.item(2).getTextContent()))
													{
														case 1 :	System.out.println(" a reçu le SMS à "+currentNList.item(1).getTextContent());
															break;
														case 2 :	System.out.println(" n'a pas pu recevoir le SMS");
															break;
														case 3 :	System.out.println(" est en attente de livraison par l'opérateur");
															break;
														case 4 :	System.out.println(" est en attente de livraison par Envoyer SMS Pro");
															break;
													}
												}
											}
											else
											{
												System.out.println("Problème lors de la récupération des status de réception :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Cancelmessage {
								
									
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/message/cancel");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair>nameValuePairs = new ArrayList<NameValuePair>(1);
											nameValuePairs.add(new BasicNameValuePair("messageid",""));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("L'envoi a bien été annulé");
												System.out.println("Le messageid : "+doc.getElementsByTagName("message_id").item(0).getTextContent());
												System.out.println("Nombre de SMS recrédité : "+doc.getElementsByTagName("recredited_sms").item(0).getTextContent());
												System.out.println("Nombre de SMS restant : "+doc.getElementsByTagName("sms_remaining").item(0).getTextContent());
											}
											else
											{
												System.out.println("Problème lors de l'annulation de l'envoi :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Getallaccounts {
								
									
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/account/getallaccounts");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Voici vos comptes : ");
												
												NodeList nList=doc.getElementsByTagName("account");
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(" ");
													NodeList currentNList = nList.item(i).getChildNodes();
													System.out.println("L'accountid : "+currentNList.item(0).getTextContent());
													System.out.println("Le nom du compte : "+currentNList.item(1).getTextContent());
													System.out.println("Le nombre de SMS restant : "+currentNList.item(2).getTextContent());
												}
											}
											else
											{
												System.out.println("Impossible de récupérer vos comptes :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Createaccount {
								
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/account/create");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
											nameValuePairs.add(new BasicNameValuePair("accountname","Nouveau compte JAVA"));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Compte créé");
												System.out.println("Votre accountid : "+doc.getElementsByTagName("account_id").item(0).getTextContent());
											}
											else
											{
												System.out.println("Le compte n'a pas été créé :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Deleteaccount {
								
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/account/delete");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
											nameValuePairs.add(new BasicNameValuePair("deleteaccountid",""));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Compte supprimé avec succès.");
												System.out.println("Voici vos comptes restants : ");
												
												NodeList nList=doc.getElementsByTagName("account");
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(" ");
													NodeList currentNList = nList.item(i).getChildNodes();
													System.out.println("L'accountid : "+currentNList.item(0).getTextContent());
													System.out.println("Le nom du compte : "+currentNList.item(1).getTextContent());
													System.out.println("Le nombre de SMS restant : "+currentNList.item(2).getTextContent());
												}
											}
											else
											{
												System.out.println("Le compte n'a pas été supprimé :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Transfersms {
									
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
								
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/account/transfer");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);
											nameValuePairs.add(new BasicNameValuePair("debitaccountid",""));
											nameValuePairs.add(new BasicNameValuePair("creditaccountid",""));
											nameValuePairs.add(new BasicNameValuePair("sms",""));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Votre transfert a bien été effectué");
												
												System.out.println(" ");
												System.out.println("Compte débité :");
												
												System.out.println("L'accountid : "+doc.getElementsByTagName("debitaccount").item(0).getChildNodes().item(0).getTextContent());
												System.out.println("Le nom du compte : "+doc.getElementsByTagName("debitaccount").item(0).getChildNodes().item(1).getTextContent());
												System.out.println("Le nombre de SMS restant : "+doc.getElementsByTagName("debitaccount").item(0).getChildNodes().item(2).getTextContent());
												
												System.out.println(" ");
												System.out.println("Compte crédité :");
												
												System.out.println("L'accountid : "+doc.getElementsByTagName("creditaccount").item(0).getChildNodes().item(0).getTextContent());
												System.out.println("Le nom du compte : "+doc.getElementsByTagName("creditaccount").item(0).getChildNodes().item(1).getTextContent());
												System.out.println("Le nombre de SMS restant : "+doc.getElementsByTagName("creditaccount").item(0).getChildNodes().item(2).getTextContent());
											}
											else
											{
												System.out.println("Le transfert de SMS n'a pas pu être effectué :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Setstopsms {
								
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";
									
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/stopsms/activate");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
											nameValuePairs.add(new BasicNameValuePair("phonenumber",""));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Le "+doc.getElementsByTagName("phone_number").item(0).getTextContent()+" est désormais en STOP SMS");
											}
											else
											{
												System.out.println("Erreur lors de la mise en STOP SMS :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			
				      			
    							import java.io.IOException;
								import java.net.MalformedURLException;
								import java.util.ArrayList;
								import java.util.List;
								
								import javax.xml.parsers.DocumentBuilder;
								import javax.xml.parsers.DocumentBuilderFactory;
								import javax.xml.parsers.ParserConfigurationException;
								
								import org.apache.commons.codec.binary.Base64;
								import org.apache.http.HttpResponse;
								import org.apache.http.NameValuePair;
								import org.apache.http.client.HttpClient;
								import org.apache.http.client.entity.UrlEncodedFormEntity;
								import org.apache.http.client.methods.HttpPost;
								import org.apache.http.impl.client.DefaultHttpClient;
								import org.apache.http.message.BasicNameValuePair;
								import org.w3c.dom.Document;
								import org.w3c.dom.NodeList;
								import org.xml.sax.SAXException;
								
								public class Unsetstopsms {
								
									public static String ENVOYERSMSPRO_LOGIN	=	"";
									public static String ENVOYERSMSPRO_PASSWORD	=	"";
									public static String ENVOYERSMSPRO_HOST		=	"www.envoyersmspro.com";
									public static String ENVOYERSMSPRO_PROTOCOL	=	"https";	
									
									/**
									 * @param args
									 */
									public static void main(String[] args) {
										// TODO Auto-generated method stub
										try {
											
											HttpClient httpClient = new DefaultHttpClient();
											
											HttpPost request = new HttpPost(ENVOYERSMSPRO_PROTOCOL+"://"+ENVOYERSMSPRO_HOST+"/api/stopsms/deactivate");
											
											String identifiant= ENVOYERSMSPRO_LOGIN + ":" + ENVOYERSMSPRO_PASSWORD;
											String encoded = Base64.encodeBase64String(identifiant.getBytes());
											
											request.addHeader("Content-Type","application/x-www-form-urlencoded");
											request.addHeader("charset","utf-8");
											request.addHeader("Authorization","Basic "+encoded);
											
											List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
											nameValuePairs.add(new BasicNameValuePair("phonenumber",""));
											request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
											
											HttpResponse response = httpClient.execute(request);
											
											DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
											DocumentBuilder dBuilder	= dbFactory.newDocumentBuilder();
								
											Document doc = dBuilder.parse(response.getEntity().getContent());
												
											doc.getDocumentElement().normalize();
											
											if(doc.getElementsByTagName("status").item(0).getTextContent().equals("success"))
											{
												System.out.println("Le "+doc.getElementsByTagName("phone_number").item(0).getTextContent()+" n'est plus en STOP SMS");
											}
											else
											{
												System.out.println("Erreur lors du retrait du STOP SMS :");
												NodeList nList=doc.getElementsByTagName("error").item(0).getChildNodes();
												for (int i = 0; i < nList.getLength(); i++)
												{
													System.out.println(nList.item(i).getNodeName()+" : "+nList.item(i).getTextContent());
												}
											}
											httpClient.getConnectionManager().shutdown();
										} catch (MalformedURLException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} 
										catch (IOException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (ParserConfigurationException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (IllegalStateException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										} catch (SAXException e) {
											// TODO Auto-generated catch block
											e.printStackTrace();
										}
									}
								
								}				      			

Nos autres langages de programmation

Vos packs SMS

section


Envoi de sms groupé
ou à l'unité


  • Sans engagement
  • Sans date limite d'utilisation
  • Sans frais supplémentaires
  • Des prix dégressifs


500 SMS

7,4 cts/unité
37 € HT
Achetez

1000 SMS

7 cts/unité
70 € HT
Achetez

5 000 SMS

6,7 cts/unité
335 € HT
Achetez

10 000 SMS

6,5 cts/unité
650 € HT
Achetez

50 000 SMS

6,2 cts/unité
3 100 € HT
Achetez

100 000 SMS

6 cts/unité
6 000 € HT
Achetez


A la carte

SMS = - € HT soit -cts/unité