Authentication API pro Android

Odesílejte OTP kódy nebo integrujte dvoufaktorové ověřování s naším API pro Android snadno a bezpečně. Vyzkoušejte zdarma naše rozhraní API pro jazyk Android. Náš tým vám pomůže zlepšit zabezpečení a ověření vaší aplikace v Android.

Funkce autentizačního API

OTP s Android

String afilnet_class="otp";
String afilnet_method="generateotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_type="number";
String afilnet_destination="34600000000";
String afilnet_time="1";
String afilnet_timetype="days";
String afilnet_length="6";
String afilnet_otpformat="all";
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+"&type="+afilnet_type+"&destination="+afilnet_destination+"&time="+afilnet_time+"&timetype="+afilnet_timetype+"&length="+afilnet_length+"&otpformat="+afilnet_otpformat+"&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="otp";
String afilnet_method="generateotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_type="number";
String afilnet_destination="34600000000";
String afilnet_time="1";
String afilnet_timetype="days";
String afilnet_length="6";
String afilnet_otpformat="all";
String afilnet_output="";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&type="+afilnet_type+"&destination="+afilnet_destination+"&time="+afilnet_time+"&timetype="+afilnet_timetype+"&length="+afilnet_length+"&otpformat="+afilnet_otpformat+"&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="otp";
String afilnet_method="generateotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_type="number";
String afilnet_destination="34600000000";
String afilnet_time="1";
String afilnet_timetype="days";
String afilnet_length="6";
String afilnet_otpformat="all";
String afilnet_output="";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&type="+afilnet_type+"&destination="+afilnet_destination+"&time="+afilnet_time+"&timetype="+afilnet_timetype+"&length="+afilnet_length+"&otpformat="+afilnet_otpformat+"&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());  
}
Parametr Popis Povinné / Nepovinné
class=otp Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=generateotp Požadovaná metoda třídy: Metoda třídy, které je žádost podána Povinný
user Uživatel a e-mail vašeho účtu Afilnet Povinný
password Heslo vašeho účtu Afilnet Povinný
type Typ skupiny (e-mail nebo mobilní) Povinný
destination Mobilní číslo nebo cílový e-mail Povinný
time Počet dní, týdnů, měsíců nebo let Volitelný
timetype Druh času (Možná hodnota: dny, týdny, měsíce nebo roky) Volitelný
length Délka hesla, které se má vygenerovat Volitelný
otpformat Formát hesla pro generování, pokud obsahuje všechny znaky, pouze čísla nebo pouze písmena (všechna, čísla, písmena) Volitelný
output Výstupní formát výsledku Volitelný
Odpovědět:
  • postavení
  • výsledek (pokud status = úspěch), zde obdržíte následující hodnoty:
    • status
    • code
  • chyba (pokud status = chyba), zde obdržíte kód chyby

Kódy chyb:
Kód Popis
MISSING_USER Uživatel nebo e-mail nejsou zahrnuty
MISSING_PASSWORD Heslo není zahrnuto
MISSING_CLASS Třída není zahrnuta
MISSING_METHOD Metoda není zahrnuta
MISSING_COMPULSORY_PARAM Povinný parametr není zahrnut
INCORRECT_USER_PASSWORD Nesprávný uživatel nebo heslo
INCORRECT_CLASS Nesprávná třída
INCORRECT_METHOD Nesprávná metoda
INCORRECT_TIME_TYPE Nesprávný typ času (možné hodnoty: dny, týdny, měsíce nebo roky)
INCORRECT_TYPE Nesprávný typ. Typ musí být mobilní nebo e-mail
INCORRECT_FORMAT Formát příjemce není správný (ověřte e-mail nebo číslo příjemce)
INCORRECT_OTP_FORMAT Formát OTP, který se má vygenerovat, neexistuje, musí to být jedna z následujících hodnot: vše, písmena, čísla

Ověřte OTP pomocí Android

String afilnet_class="otp";
String afilnet_method="generateotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_type="number";
String afilnet_destination="34600000000";
String afilnet_time="1";
String afilnet_timetype="days";
String afilnet_length="6";
String afilnet_otpformat="all";
String afilnet_output="";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&type="+afilnet_type+"&destination="+afilnet_destination+"&time="+afilnet_time+"&timetype="+afilnet_timetype+"&length="+afilnet_length+"&otpformat="+afilnet_otpformat+"&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());  
}String afilnet_class="otp";
String afilnet_method="verifyotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_destination="34600000000";
String afilnet_code="A73HF3I";
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+"&destination="+afilnet_destination+"&code="+afilnet_code+"&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="otp";
String afilnet_method="verifyotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_destination="34600000000";
String afilnet_code="A73HF3I";
String afilnet_output="";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&destination="+afilnet_destination+"&code="+afilnet_code+"&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="otp";
String afilnet_method="verifyotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_destination="34600000000";
String afilnet_code="A73HF3I";
String afilnet_output="";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&destination="+afilnet_destination+"&code="+afilnet_code+"&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());  
}
Parametr Popis Povinné / Nepovinné
class=otp Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=verifyotp Požadovaná metoda třídy: Metoda třídy, které je žádost podána Povinný
user Uživatel a e-mail vašeho účtu Afilnet Povinný
password Heslo vašeho účtu Afilnet Povinný
destination Mobilní číslo nebo cílový e-mail Povinný
code Heslo k ověření Volitelný
output Výstupní formát výsledku Volitelný
Odpovědět:
  • postavení
  • výsledek (pokud status = úspěch), zde obdržíte následující hodnoty:
    • Nebudou vám zasílány žádné další hodnoty
  • chyba (pokud status = chyba), zde obdržíte kód chyby

Kódy chyb:
Kód Popis
MISSING_USER Uživatel nebo e-mail nejsou zahrnuty
MISSING_PASSWORD Heslo není zahrnuto
MISSING_CLASS Třída není zahrnuta
MISSING_METHOD Metoda není zahrnuta
MISSING_COMPULSORY_PARAM Povinný parametr není zahrnut
INCORRECT_USER_PASSWORD Nesprávný uživatel nebo heslo
INCORRECT_CLASS Nesprávná třída
INCORRECT_METHOD Nesprávná metoda
CODE_NOT_FOUND Odeslaný kód je nesprávný nebo jeho platnost vypršela

Vrátí stav doručení certifikované SMS s PHP Vrátí stav doručení certifikované SMS s Java Vrátí stav doručení certifikované SMS s C Sharp Vrátí stav doručení certifikované SMS s Unix Vrátí stav doručení certifikované SMS s Ruby on Rails Vrátí stav doručení certifikované SMS s Python Vrátí stav doručení certifikované SMS s Android Vrátí stav doručení certifikované SMS s Objective C / iPhone Vrátí stav doručení certifikované SMS s SQL Server Vrátí stav doručení certifikované SMS s Oracle Vrátí stav doručení certifikované SMS s Node JS Vrátí stav doručení certifikované SMS s Go lang Vrátí stav doručení certifikované SMS s Scala lang Vrátí stav doručení certifikované SMS s Swift Vrátí stav doručení certifikované SMS s Delphi

Afilnet vám nabízí způsoby, jak zlepšit bezpečnost při používání našeho API s Android, díky možnosti vytváření přístupů a možnosti aktivace filtrování podle IP.

Které rozhraní API pro jazyk Android mám použít?

Objevte výhody a nevýhody každého z našich API. Zjistěte, které API je pro váš software nejlepší v jazyce Android.

Toto rozhraní API vám umožňuje připojit se k nám z Android a odesílat požadavky prostřednictvím požadavků HTTP GET. Tento požadavek odešle parametry ve stejné adrese URL jako požadavek.

  • HTTP GET se velmi jednoduše implementuje
  • Informace jsou odesílány nešifrované (hesla mohou být extrahována z protokolů nebo mezipaměti)
  • Maximální požadavek na ~4000 znaků

Rozhraní API požadavku POST vám umožňuje připojit se k našemu rozhraní API z Android odesláním parametrů požadavku prostřednictvím parametrů HTTP POST. Informace jsou odesílány nezávisle na URL.

  • HTTP POST se snadno implementuje
  • Informace jsou odesílány šifrovaně
  • Velikost požadavku není nijak omezena
  • Střední zabezpečení

Základní autentizační API umožňuje použití požadavků GET a POST v Android s další vrstvou zabezpečení, protože v tomto případě se uživatelské jméno a heslo zasílají v záhlaví požadavku.

  • Základní autentizace se snadno implementuje
  • Přístupová data jsou odesílána šifrovaná
  • Limit velikosti závisí na použití GET nebo POST
  • Střední zabezpečení

SOAP umožňuje posílat požadavky ve formátu XML s Android, SOAP přidává další vrstvu zabezpečení žádostem API.

  • Integrace SOAP je složitější
  • Informace jsou odesílány šifrovaně
  • Velikost požadavku není nijak omezena
  • Střední / vysoká bezpečnost

Naše JSON API vám umožňuje odesílat požadavky ve formátu JSON s Android, navíc toto API přidává do ověřování protokol oAuth 2.0, který vám umožňuje přidat další vrstvu zabezpečení.

  • Integrace JSON oAuth 2.0 je složitější
  • Informace jsou odesílány šifrovaně
  • Velikost požadavku není nijak omezena
  • Vysoká bezpečnost

Propojte Android s naším OTP (jednorázové heslo) API

01

Zaregistrujte se jako klient

Abyste měli přístup k API, musíte být klientem Afilnetu. Registrace zabere několik minut.

02

Požádejte o bezplatnou zkušební verzi

Naše společnost vám nabídne zkušební zůstatek, který vám umožní testovat s API, které potřebujete.

03

Integrujte rozhraní API

Proveďte integraci API pomocí programovacího jazyka dle vašeho výběru. Pokud máte nějaké dotazy nebo návrhy ohledně API, kontaktujte nás

04

Vítejte v Afilnetu!

Vše připraveno !, se podařilo zlepšit komunikaci s Afilnet. Jsme tu, abychom podporovali naše API, když to potřebujete


V případě dotazů kontaktujte náš tým prostřednictvím kontaktních metod, které nabízíme. Náš tým se vám pokusí nabídnout okamžité řešení a pomůže vám s integrací našeho API do vašeho softwaru.

Vyzkoušejte Afilnet zdarma!

Zaregistrujte se zdarma a vyzkoušejte Afilnet! Nabízíme vám bezplatnou zkušební verzi našich služeb. *



(*) Akce platí pouze pro společnosti, které nikdy předtím službu Afilnet nevyužívaly. Při žádosti o bezplatný zůstatek může Afilnet požádat o ověření informací o vaší společnosti


Hromadná SMS · Emailový marketing · Sociální síť · Okamžité zprávy · Osvědčení · a mnohem víc
Pokračovat DŮLEŽITÉ INFORMACE O COOKIES: Pokud budete i nadále používat tento web, budeme předpokládat, že souhlasíte s podmínkami použití. Více informací naleznete v našich Zásadách používání cookies.
Platební metody
Drátový převod
Kreditní karta
Paypal
Western Union
Skrill
Crypto
Afilnet ve vašem jazyce

Copyright © 2023 Afilnet · Všechna práva vyhrazena