SMS versenden mit Android
Senden Sie SMS mit Android
Android : METHODE
SMS
- SMS versenden mit Android
- SMS aus Vorlage versenden mit Android
- EMassen-SMS versenden mit Android
- Massen-SMS aus Vorlage versenden mit Android
- SMS-Zustellstatus abfragen mit Android
SPRACHNACHRICHTEN
- Sprachnachricht senden mit Android
- Stimme aus Vorlage versenden mit Android
- Massen-Stimme versenden mit Android
- Massen-Stimme aus Vorlage versenden mit Android
- Sprachausgabestatus abfragen mit Android
- E-Mail versenden mit Android
- E-Mail aus Vorlage versenden mit Android
- Massen-E-Mail versenden mit Android
- Massen-E-Mail aus Vorlage versenden mit Android
- E-Mail-Zustellstatus abfragen mit Android
SOZIALE NETZWERKE
GRUPPE
- Gruppe anlegen mit Android
- Felder aus einer Gruppe abrufen mit Android
- Feld zu einer Gruppe hinzufügen mit Android
- Feld aus einer Gruppe entfernen mit Android
- Einen Kontakt aus einer Gruppe löschen
- Land einer Gruppe zuordnen mit Android
- Kontakte der Gruppe abrufen mit Android
- Kontakt zur Gruppe hinzufügen mit Android
- Kontakt der Gruppe ändern mit Android
- Kontakt aus der Gruppe entfernen mit Android
HLR
PAÍSES
VERANSTALTUNGEN
- Ereignis zur Gruppe hinzufügen mit Android
- Ereignisse der Gruppe abrufen mit Android
- Ereignis aus einer Gruppe löschen mit Android
USER
SCHABLONEN
OTP (ONE-TIME PASSWORD)
Este método le permite enviar SMS a un destinatario utilizando Android. Enviar un SMS con Android es tan sencillo como enviar el origin, destino y el mensaje a enviar a través de una petición a nuestra API.
String afilnet_class="sms";
String afilnet_method="sendsms";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_from="Afilnet";
String afilnet_to="34600000000";
String afilnet_sms="sms+test";
String afilnet_scheduledatetime="";
String afilnet_output="";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&from="+afilnet_from+"&to="+afilnet_to+"&sms="+afilnet_sms+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output;
URL url = new URL(sUrl);
StringBuilder builder = new StringBuilder();
BufferedReader theJSONline = new BufferedReader(new InputStreamReader(url.openStream()));
builder.append(theJSONline.readLine());
String content = builder.toString();
String afilnet_class="sms";
String afilnet_method="sendsms";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_from="Afilnet";
String afilnet_to="34600000000";
String afilnet_sms="sms+test";
String afilnet_scheduledatetime="";
String afilnet_output="";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&from="+afilnet_from+"&to="+afilnet_to+"&sms="+afilnet_sms+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output;
// We generate the URL
URL myurl = new URL("https://www.afilnet.com/api/http/");
// We create the connection
HttpURLConnection con = (HttpURLConnection) myurl.openConnection();
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("Content-Length", String.valueOf(post.length()));
con.setRequestMethod("POST");
// We build the
OutputStream os = con.getOutputStream();
os.write(post.getBytes());
os.close();
StringBuilder sb = new StringBuilder();
int HttpResult = con.getResponseCode();
if(HttpResult == HttpURLConnection.HTTP_OK)
{
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(),"utf-8"));
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
}
br.close();
System.out.println(""+sb.toString());
} else {
System.out.println(con.getResponseCode());
System.out.println(con.getResponseMessage());
}
String afilnet_class="sms";
String afilnet_method="sendsms";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_from="Afilnet";
String afilnet_to="34600000000";
String afilnet_sms="sms+test";
String afilnet_scheduledatetime="";
String afilnet_output="";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&from="+afilnet_from+"&to="+afilnet_to+"&sms="+afilnet_sms+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output;
// We generate the URL
URL myurl = new URL("https://www.afilnet.com/api/basic/");
// We create the connection
HttpURLConnection con = (HttpURLConnection) myurl.openConnection();
String encoded = Base64.getEncoder().encodeToString((afilnet_user+":"+afilnet_password).getBytes(StandardCharsets.UTF_8));
con.setRequestProperty("Authorization", "Basic "+encoded);
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("Content-Length", String.valueOf(post.length()));
con.setRequestMethod("POST");
// We build the
OutputStream os = con.getOutputStream();
os.write(post.getBytes());
os.close();
StringBuilder sb = new StringBuilder();
int HttpResult = con.getResponseCode();
if(HttpResult == HttpURLConnection.HTTP_OK)
{
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(),"utf-8"));
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
}
br.close();
System.out.println(""+sb.toString());
} else {
System.out.println(con.getResponseCode());
System.out.println(con.getResponseMessage());
}
Versenden Sie SMS einer Handynummer
Parameter | Beschreibung | Zwigend / optional |
---|---|---|
class=sms | Sorte deren Antragen sich realisiert | Zwigend |
method=sendsms | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
from | Absender | Zwigend |
to | Handynummer Ziele | Zwigend |
sms | SMS Nachricht versenden | Zwigend |
scheduledatetime | Versanddaten und Zeit in yyyy-mm-dd hh:mm:ss Format | Optional |
output | Ergebnisse Ausgabeformat | Optional |
Aus Sie die Anfragen verwenden,werden Sie die nächster Datenfeld bekommen:
- status
- result (si status=success), Sie werden die nächsten Codes bekommen:
- messageid
- credits
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Die mögliche Fehlercode sind die nächster:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NO_ROUTE_AVAILABLE | Es hat nicht verfügbar Routen für die angezeigter Ziel |
NO_CREDITS | Sie verfügt nicht auf genug Betriebsergebnis |
Parameter:
- class: sms
- method: sendsms
- user: user
- password: password
- from: Afilnet
- to: 34600000000
- sms: sms+test
- scheduledatetime:
- output:
Anforderung:
https://www.afilnet.com/api/http/?class=sms&method=sendsms&user=user&password=password&from=Afilnet&to=34600000000&sms=sms+test&scheduledatetime=&output=