User Management API i Android

Administrer brugeroplysninger, kend saldoen du har på din konto og administrer dine adresser.

Få kontosaldo med Android

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());  
}
Parameter Beskrivelse Obligatorisk / valgfri
class=user Klasse anmodet: Klasse, som anmodningen indgives til Obligatorisk
method=getbalance Anmodet om klassemetode: Metode for den klasse, som anmodningen indgives til Obligatorisk
user Bruger og e-mail på din Afilnet-konto Obligatorisk
password Adgangskode til din Afilnet-konto Obligatorisk
Svar:
  • status
  • resultat (hvis status = succes), her vil du modtage følgende værdier:
    • Ingen yderligere værdier sendes til dig
  • fejl (hvis status = fejl), her vil du modtage fejlkoden

Fejlkoder:
Kode Beskrivelse
MISSING_USER Bruger eller e-mail er ikke inkluderet
MISSING_PASSWORD Adgangskode er ikke inkluderet
MISSING_CLASS Klasse ikke inkluderet
MISSING_METHOD Metode er ikke inkluderet
MISSING_COMPULSORY_PARAM Obligatorisk parameter ikke inkluderet
INCORRECT_USER_PASSWORD Forkert bruger eller adgangskode
INCORRECT_CLASS Forkert klasse
INCORRECT_METHOD Forkert metode

Tilføj ny adresse med {sprog}

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());  
}
Parameter Beskrivelse Obligatorisk / valgfri
class=user Klasse anmodet: Klasse, som anmodningen indgives til Obligatorisk
method=addaddress Anmodet om klassemetode: Metode for den klasse, som anmodningen indgives til Obligatorisk
user Bruger og e-mail på din Afilnet-konto Obligatorisk
password Adgangskode til din Afilnet-konto Obligatorisk
namelastname Kontaktpersonens navn og efternavn Obligatorisk
iscompany (0) Hvis det er en fysisk person, eller (1) hvis det er en virksomhed Obligatorisk
companyname Virksomhedens navn (hvis det er et firma) Valgfri
documentid Kode til virksomhedsidentifikationsdokument Obligatorisk
countrycode ISO-landekode i ISO-3166-1 ALPHA-2-format Obligatorisk
cityid Byidentifikator Obligatorisk
cityname Navnet på den by eller by, den tilhører Obligatorisk
zipcode postnummer Obligatorisk
address Fysisk adresse Obligatorisk
Svar:
  • status
  • resultat (hvis status = succes), her vil du modtage følgende værdier:
    • Ingen yderligere værdier sendes til dig
  • fejl (hvis status = fejl), her vil du modtage fejlkoden

Fejlkoder:
Kode Beskrivelse
MISSING_USER Bruger eller e-mail er ikke inkluderet
MISSING_PASSWORD Adgangskode er ikke inkluderet
MISSING_CLASS Klasse ikke inkluderet
MISSING_METHOD Metode er ikke inkluderet
MISSING_COMPULSORY_PARAM Obligatorisk parameter ikke inkluderet
INCORRECT_USER_PASSWORD Forkert bruger eller adgangskode
INCORRECT_CLASS Forkert klasse
INCORRECT_METHOD Forkert metode
EMPTY_COUNTRYCODE Landekoden er tom
COUNTRY_NOT_FOUND Der er intet land med den angivne kode
EMPTY_CITY Du har ikke angivet byen
CITY_NOT_FOUND Den angivne by findes ikke

Fjern en adresse med {sprog}

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());  
}
Parameter Beskrivelse Obligatorisk / valgfri
class=user Klasse anmodet: Klasse, som anmodningen indgives til Obligatorisk
method=deleteaddress Anmodet om klassemetode: Metode for den klasse, som anmodningen indgives til Obligatorisk
user Bruger og e-mail på din Afilnet-konto Obligatorisk
password Adgangskode til din Afilnet-konto Obligatorisk
idaddress Brugerkonto adresse-id Obligatorisk
Svar:
  • status
  • resultat (hvis status = succes), her vil du modtage følgende værdier:
    • Ingen yderligere værdier sendes til dig
  • fejl (hvis status = fejl), her vil du modtage fejlkoden

Fejlkoder:
Kode Beskrivelse
MISSING_USER Bruger eller e-mail er ikke inkluderet
MISSING_PASSWORD Adgangskode er ikke inkluderet
MISSING_CLASS Klasse ikke inkluderet
MISSING_METHOD Metode er ikke inkluderet
MISSING_COMPULSORY_PARAM Obligatorisk parameter ikke inkluderet
INCORRECT_USER_PASSWORD Forkert bruger eller adgangskode
INCORRECT_CLASS Forkert klasse
INCORRECT_METHOD Forkert metode

Hent adresselisten med {sprog}

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());  
}
Parameter Beskrivelse Obligatorisk / valgfri
class=user Klasse anmodet: Klasse, som anmodningen indgives til Obligatorisk
method=getaddresses Anmodet om klassemetode: Metode for den klasse, som anmodningen indgives til Obligatorisk
user Bruger og e-mail på din Afilnet-konto Obligatorisk
password Adgangskode til din Afilnet-konto Obligatorisk
Svar:
  • status
  • resultat (hvis status = succes), her vil du modtage følgende værdier:
    • list
      • id
      • namelastname
      • iscompany
      • companyname
      • documentid
      • countrycode
      • cityid
      • cityname
      • zipcode
      • address
      • verified
      • addressverified
  • fejl (hvis status = fejl), her vil du modtage fejlkoden

Fejlkoder:
Kode Beskrivelse
MISSING_USER Bruger eller e-mail er ikke inkluderet
MISSING_PASSWORD Adgangskode er ikke inkluderet
MISSING_CLASS Klasse ikke inkluderet
MISSING_METHOD Metode er ikke inkluderet
MISSING_COMPULSORY_PARAM Obligatorisk parameter ikke inkluderet
INCORRECT_USER_PASSWORD Forkert bruger eller adgangskode
INCORRECT_CLASS Forkert klasse
INCORRECT_METHOD Forkert metode

Hent kanalliste med {sprog}

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());  
}
Parameter Beskrivelse Obligatorisk / valgfri
class=user Klasse anmodet: Klasse, som anmodningen indgives til Obligatorisk
method=getchannels Anmodet om klassemetode: Metode for den klasse, som anmodningen indgives til Obligatorisk
user Bruger og e-mail på din Afilnet-konto Obligatorisk
password Adgangskode til din Afilnet-konto Obligatorisk
Svar:
  • status
  • resultat (hvis status = succes), her vil du modtage følgende værdier:
    • list
      • channeltype
      • channelname
      • active
  • fejl (hvis status = fejl), her vil du modtage fejlkoden

Fejlkoder:
Kode Beskrivelse
MISSING_USER Bruger eller e-mail er ikke inkluderet
MISSING_PASSWORD Adgangskode er ikke inkluderet
MISSING_CLASS Klasse ikke inkluderet
MISSING_METHOD Metode er ikke inkluderet
MISSING_COMPULSORY_PARAM Obligatorisk parameter ikke inkluderet
INCORRECT_USER_PASSWORD Forkert bruger eller adgangskode
INCORRECT_CLASS Forkert klasse
INCORRECT_METHOD Forkert metode

Rediger status på en kanal med {sprog}

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());  
}
Parameter Beskrivelse Obligatorisk / valgfri
class=user Klasse anmodet: Klasse, som anmodningen indgives til Obligatorisk
method=modifychannel Anmodet om klassemetode: Metode for den klasse, som anmodningen indgives til Obligatorisk
user Bruger og e-mail på din Afilnet-konto Obligatorisk
password Adgangskode til din Afilnet-konto Obligatorisk
channelname Kanalnavn Obligatorisk
active (1) Aktivér eller (0) Deaktiver Obligatorisk
Svar:
  • status
  • resultat (hvis status = succes), her vil du modtage følgende værdier:
    • Ingen yderligere værdier sendes til dig
  • fejl (hvis status = fejl), her vil du modtage fejlkoden

Fejlkoder:
Kode Beskrivelse
MISSING_USER Bruger eller e-mail er ikke inkluderet
MISSING_PASSWORD Adgangskode er ikke inkluderet
MISSING_CLASS Klasse ikke inkluderet
MISSING_METHOD Metode er ikke inkluderet
MISSING_COMPULSORY_PARAM Obligatorisk parameter ikke inkluderet
INCORRECT_USER_PASSWORD Forkert bruger eller adgangskode
INCORRECT_CLASS Forkert klasse
INCORRECT_METHOD Forkert metode

Returnerer leveringsstatus for certificeret sms med PHP Returnerer leveringsstatus for certificeret sms med Java Returnerer leveringsstatus for certificeret sms med C Sharp Returnerer leveringsstatus for certificeret sms med Unix Returnerer leveringsstatus for certificeret sms med Ruby on rails Returnerer leveringsstatus for certificeret sms med Python Returnerer leveringsstatus for certificeret sms med Android Returnerer leveringsstatus for certificeret sms med Objective C / iPhone Returnerer leveringsstatus for certificeret sms med SQL Server Returnerer leveringsstatus for certificeret sms med Oracle Returnerer leveringsstatus for certificeret sms med Node JS Returnerer leveringsstatus for certificeret sms med Go lang Returnerer leveringsstatus for certificeret sms med Scala lang Returnerer leveringsstatus for certificeret sms med Swift Returnerer leveringsstatus for certificeret sms med Delphi

Afilnet tilbyder dig metoder til at forbedre sikkerheden, når du bruger vores API med Android, takket være muligheden for at oprette adgange og muligheden for at aktivere filtrering efter IP.

Hvilken API til Android skal jeg bruge?

Opdag fordelene og ulemperne ved hver af vores API'er. Find ud af, hvilken API der er bedst til din software på Android.

Denne API giver dig mulighed for at oprette forbindelse til os fra Android for at sende anmodninger via HTTP GET-anmodninger. Denne anmodning sender parametrene i samme URL som anmodningen.

  • HTTP GET er ekstremt simpelt at implementere
  • Oplysninger sendes ukrypteret (adgangskoder kan udtrækkes fra logfiler eller cache)
  • Maksimal anmodning på ~4000 tegn

POST request API giver dig mulighed for at oprette forbindelse til vores API fra Android ved at sende anmodningsparametre via HTTP POST-parametre. Oplysningerne sendes uafhængigt af URL'en.

  • HTTP POST er enkel at implementere
  • Information sendes krypteret
  • Der er ingen grænse for størrelsen af anmodningen
  • Middel sikkerhed

Den grundlæggende autentificerings-API tillader brugen af GET- og POST-anmodninger på Android med et ekstra sikkerhedslag, da brugernavnet og adgangskoden i dette tilfælde sendes i overskriften på anmodningen.

  • Grundlæggende godkendelse er nem at implementere
  • Adgangsdata sendes krypteret
  • Størrelsesgrænsen afhænger af brugen af GET eller POST
  • Middel sikkerhed

SOAP giver dig mulighed for at sende anmodninger i XML-format med Android, SOAP tilføjer et ekstra lag af sikkerhed til API-anmodninger.

  • SOAP-integration er mere kompleks
  • Information sendes krypteret
  • Der er ingen grænse for størrelsen af anmodningen
  • Middel / Høj sikkerhed

Vores JSON API giver dig mulighed for at sende anmodninger i JSON-format med Android, derudover tilføjer denne API oAuth 2.0-protokollen i godkendelsen, der giver dig mulighed for at tilføje et ekstra lag af sikkerhed.

  • JSON oAuth 2.0-integration er mere kompleks
  • Information sendes krypteret
  • Der er ingen grænse for størrelsen af anmodningen
  • Høj sikkerhed

Opret forbindelse {sprog} med vores Bruger API

01

Registrer dig som klient

For at få adgang til API'en skal du være en Afilnet-klient. Registrering vil tage et par minutter.

02

Anmod om din gratis prøveperiode

Vores firma vil tilbyde dig en prøvebalance, der giver dig mulighed for at teste med den API, du har brug for.

03

Integrer API

Udfør API-integration ved hjælp af det programmeringssprog, du vælger. Hvis du har spørgsmål eller forslag til API'et, så kontakt os

04

Velkommen til Afilnet!

Alt klar !, har formået at forbedre sin kommunikation med Afilnet. Vi er her for at støtte vores API, når du har brug for det


Kontakt vores team med eventuelle spørgsmål gennem de kontaktmetoder, vi tilbyder. Vores team vil forsøge at tilbyde dig en øjeblikkelig løsning og vil hjælpe dig med integrationen af vores API i din software.

Prøv Afilnet gratis!

Tilmeld dig gratis, og prøv Afilnet! Vi tilbyder dig en gratis prøveperiode på vores tjenester. *



(*) Kampagnen gælder kun for virksomheder, der aldrig har brugt Afilnet-tjenesten før. Når du anmoder om den gratis saldo, kan Afilnet anmode om at bekræfte dine virksomhedsoplysninger


Bulk SMS · E-mail-marketing · Socialt netværk · Øjeblikkelig udveksling af beskeder · Certificering · og meget mere
Blive ved VIGTIG INFORMATION OM COOKIES: Hvis du fortsætter med at bruge denne web, antager vi, at du accepterer vilkårene for brug. Du finder flere oplysninger i vores cookiepolitik.
Betalingsmetoder
Bankoverførsel
Kreditkort
Paypal
Western Union
Skrill
Crypto
Afilnet på dit sprog

Copyright © 2023 Afilnet · Alle rettigheder forbeholdes