User Management API v Java

Spravujte informace o uživatelích, zjistěte zůstatek na svém účtu a spravujte své adresy.

Získejte zůstatek na účtu pomocí Java

String afilnet_class="user";
String afilnet_method="getbalance";
String afilnet_user="user";
String afilnet_password="password";

// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password;
	  
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="user";
String afilnet_method="getbalance";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password;
	  
// 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="user";
String afilnet_method="getbalance";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method;
	  
// 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=user Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=getbalance 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ý
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

Přidat novou adresu pomocí Java

String afilnet_class="user";
String afilnet_method="getbalance";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method;
	  
// 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="user";
String afilnet_method="addaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_namelastname="name+lastname";
String afilnet_iscompany="1";
String afilnet_companyname="mycompany";
String afilnet_documentid="123456789A";
String afilnet_countrycode="us";
String afilnet_cityid="1";
String afilnet_cityname="town";
String afilnet_zipcode="123456";
String afilnet_address="address";

// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&namelastname="+afilnet_namelastname+"&iscompany="+afilnet_iscompany+"&companyname="+afilnet_companyname+"&documentid="+afilnet_documentid+"&countrycode="+afilnet_countrycode+"&cityid="+afilnet_cityid+"&cityname="+afilnet_cityname+"&zipcode="+afilnet_zipcode+"&address="+afilnet_address;
	  
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="user";
String afilnet_method="addaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_namelastname="name+lastname";
String afilnet_iscompany="1";
String afilnet_companyname="mycompany";
String afilnet_documentid="123456789A";
String afilnet_countrycode="us";
String afilnet_cityid="1";
String afilnet_cityname="town";
String afilnet_zipcode="123456";
String afilnet_address="address";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&namelastname="+afilnet_namelastname+"&iscompany="+afilnet_iscompany+"&companyname="+afilnet_companyname+"&documentid="+afilnet_documentid+"&countrycode="+afilnet_countrycode+"&cityid="+afilnet_cityid+"&cityname="+afilnet_cityname+"&zipcode="+afilnet_zipcode+"&address="+afilnet_address;
	  
// 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="user";
String afilnet_method="addaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_namelastname="name+lastname";
String afilnet_iscompany="1";
String afilnet_companyname="mycompany";
String afilnet_documentid="123456789A";
String afilnet_countrycode="us";
String afilnet_cityid="1";
String afilnet_cityname="town";
String afilnet_zipcode="123456";
String afilnet_address="address";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&namelastname="+afilnet_namelastname+"&iscompany="+afilnet_iscompany+"&companyname="+afilnet_companyname+"&documentid="+afilnet_documentid+"&countrycode="+afilnet_countrycode+"&cityid="+afilnet_cityid+"&cityname="+afilnet_cityname+"&zipcode="+afilnet_zipcode+"&address="+afilnet_address;
	  
// 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=user Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=addaddress 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ý
namelastname Jméno a příjmení kontaktní osoby Povinný
iscompany (0) Pokud se jedná o fyzickou osobu nebo (1) je-li to společnost Povinný
companyname Název společnosti (v případě, že se jedná o společnost) Volitelný
documentid Kód identifikačního dokumentu společnosti Povinný
countrycode Kód země ISO ve formátu ISO-3166-1 ALPHA-2 Povinný
cityid Identifikátor města Povinný
cityname Název města, do kterého patří Povinný
zipcode poštovní směrovací číslo Povinný
address Fyzická adresa Povinný
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
EMPTY_COUNTRYCODE Kód země je prázdný
COUNTRY_NOT_FOUND Neexistuje žádná země s uvedeným kódem
EMPTY_CITY Neuvedli jste město
CITY_NOT_FOUND Uvedené město neexistuje

Odebrat adresu pomocí Java

String afilnet_class="user";
String afilnet_method="addaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_namelastname="name+lastname";
String afilnet_iscompany="1";
String afilnet_companyname="mycompany";
String afilnet_documentid="123456789A";
String afilnet_countrycode="us";
String afilnet_cityid="1";
String afilnet_cityname="town";
String afilnet_zipcode="123456";
String afilnet_address="address";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&namelastname="+afilnet_namelastname+"&iscompany="+afilnet_iscompany+"&companyname="+afilnet_companyname+"&documentid="+afilnet_documentid+"&countrycode="+afilnet_countrycode+"&cityid="+afilnet_cityid+"&cityname="+afilnet_cityname+"&zipcode="+afilnet_zipcode+"&address="+afilnet_address;
	  
// 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="user";
String afilnet_method="deleteaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idaddress="1000";

// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idaddress="+afilnet_idaddress;
	  
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="user";
String afilnet_method="deleteaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idaddress="1000";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idaddress="+afilnet_idaddress;
	  
// 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="user";
String afilnet_method="deleteaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idaddress="1000";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idaddress="+afilnet_idaddress;
	  
// 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=user Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=deleteaddress 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ý
idaddress ID adresy uživatelského účtu Povinný
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

Získejte seznam adres pomocí jazyka Java

String afilnet_class="user";
String afilnet_method="deleteaddress";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idaddress="1000";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idaddress="+afilnet_idaddress;
	  
// 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="user";
String afilnet_method="getaddresses";
String afilnet_user="user";
String afilnet_password="password";

// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password;
	  
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="user";
String afilnet_method="getaddresses";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password;
	  
// 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="user";
String afilnet_method="getaddresses";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method;
	  
// 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=user Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=getaddresses 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ý
Odpovědět:
  • postavení
  • výsledek (pokud status = úspěch), zde obdržíte následující hodnoty:
    • list
      • id
      • namelastname
      • iscompany
      • companyname
      • documentid
      • countrycode
      • cityid
      • cityname
      • zipcode
      • address
      • verified
      • addressverified
  • 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

Získejte seznam kanálů pomocí jazyka Java

String afilnet_class="user";
String afilnet_method="getaddresses";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method;
	  
// 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="user";
String afilnet_method="getchannels";
String afilnet_user="user";
String afilnet_password="password";

// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password;
	  
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="user";
String afilnet_method="getchannels";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password;
	  
// 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="user";
String afilnet_method="getchannels";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method;
	  
// 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=user Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=getchannels 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ý
Odpovědět:
  • postavení
  • výsledek (pokud status = úspěch), zde obdržíte následující hodnoty:
    • list
      • channeltype
      • channelname
      • active
  • 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

Upravte stav kanálu pomocí Java

String afilnet_class="user";
String afilnet_method="getchannels";
String afilnet_user="user";
String afilnet_password="password";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method;
	  
// 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="user";
String afilnet_method="modifychannel";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_channelname="sms";
String afilnet_active="1";

// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&channelname="+afilnet_channelname+"&active="+afilnet_active;
	  
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="user";
String afilnet_method="modifychannel";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_channelname="sms";
String afilnet_active="1";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&channelname="+afilnet_channelname+"&active="+afilnet_active;
	  
// 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="user";
String afilnet_method="modifychannel";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_channelname="sms";
String afilnet_active="1";

// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&channelname="+afilnet_channelname+"&active="+afilnet_active;
	  
// 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=user Požadovaná třída: Třída, na kterou je žádost podána Povinný
method=modifychannel 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ý
channelname Název kanálu Povinný
active (1) Povolit nebo (0) Zakázat Povinný
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

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 Java, díky možnosti vytváření přístupů a možnosti aktivace filtrování podle IP.

Které rozhraní API pro jazyk Java 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 Java.

Toto rozhraní API vám umožňuje připojit se k nám z Java 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 Java 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 Java 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 Java, 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 Java, 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 Java s naším Uživatel 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