Kontakte-API
Verwalten Sie Ihre Gruppen (Gruppen erstellen, ändern oder löschen) und Kontakte mit unserer API für Kontakte.
Gruppe anlegen mit Java
String afilnet_class="group";
String afilnet_method="creategroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_name="test name";
String afilnet_type="mobile";
String afilnet_fields="mobile,name,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+"&name="+afilnet_name+"&type="+afilnet_type+"&fields="+afilnet_fields;
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="group";
String afilnet_method="creategroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_name="test name";
String afilnet_type="mobile";
String afilnet_fields="mobile,name,address";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&name="+afilnet_name+"&type="+afilnet_type+"&fields="+afilnet_fields;
// 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="group";
String afilnet_method="creategroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_name="test name";
String afilnet_type="mobile";
String afilnet_fields="mobile,name,address";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&name="+afilnet_name+"&type="+afilnet_type+"&fields="+afilnet_fields;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=creategroup | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
name | Gruppenname | Zwigend |
type | Gruppentyp (email oder mobile) | Zwigend |
fields | Felderauflistung per Kommas separat, obligatorisch zu enthalten einem Handyfeld Typ = mobile und einem Emailfelder ohne Typ = Email | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
INCORRECT_TYPE | Inkorrekt Type, es must mobile oder Email zu sein |
MISSING_MAIN_FIELD | Es mangelt der Hauptfeld (mobile ob Type = mobile oder email ob Type = email) |
Felder aus einer Gruppe abfragen mit Java
String afilnet_class="group";
String afilnet_method="creategroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_name="test name";
String afilnet_type="mobile";
String afilnet_fields="mobile,name,address";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&name="+afilnet_name+"&type="+afilnet_type+"&fields="+afilnet_fields;
// 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="group";
String afilnet_method="getgroupcolumns";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="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+"&idgroup="+afilnet_idgroup;
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="group";
String afilnet_method="getgroupcolumns";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup;
// 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="group";
String afilnet_method="getgroupcolumns";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=getgroupcolumns | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Feld zu einer Gruppe hinzufügen mit Java
String afilnet_class="group";
String afilnet_method="getgroupcolumns";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup;
// 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="group";
String afilnet_method="addcolumntogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
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="group";
String afilnet_method="addcolumntogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
// 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="group";
String afilnet_method="addcolumntogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=addcolumntogroup | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
field | Gruppenfelder | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Feld aus einer Gruppe entfernen mit Java
String afilnet_class="group";
String afilnet_method="addcolumntogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
// 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="group";
String afilnet_method="deletecolumnfromgroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
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="group";
String afilnet_method="deletecolumnfromgroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
// 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="group";
String afilnet_method="deletecolumnfromgroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=deletecolumnfromgroup | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
field | Gruppenfeler | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Löschen eines Gruppenkontakts mit Java
String afilnet_class="group";
String afilnet_method="deletecolumnfromgroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_field="name";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&field="+afilnet_field;
// 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="group";
String afilnet_method="deletegroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="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+"&idgroup="+afilnet_idgroup;
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="group";
String afilnet_method="deletegroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup;
// 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="group";
String afilnet_method="deletegroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=deletegroup | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Land einer Gruppe zuordnen mit Java
String afilnet_class="group";
String afilnet_method="deletegroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup;
// 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="group";
String afilnet_method="assigncountrytogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_countryiso3="esp";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&countryiso3="+afilnet_countryiso3;
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="group";
String afilnet_method="assigncountrytogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_countryiso3="esp";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&countryiso3="+afilnet_countryiso3;
// 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="group";
String afilnet_method="assigncountrytogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_countryiso3="esp";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&countryiso3="+afilnet_countryiso3;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=assigncountrytogroup | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
countryiso3 | ISO Code auf das Land | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
COUNTRY_NOT_FOUND | Es gibt kein Land mit dem angegebenen Code |
Gruppenkontakte abrufen mit Java
String afilnet_class="group";
String afilnet_method="assigncountrytogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_countryiso3="esp";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&countryiso3="+afilnet_countryiso3;
// 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="group";
String afilnet_method="getcontacts";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="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+"&idgroup="+afilnet_idgroup;
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="group";
String afilnet_method="getcontacts";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup;
// 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="group";
String afilnet_method="getcontacts";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=getcontacts | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Holen Sie sich einen Kontakt aus einer Gruppe mit Java
String afilnet_class="group";
String afilnet_method="getcontacts";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup;
// 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="group";
String afilnet_method="getcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="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+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
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="group";
String afilnet_method="getcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
// 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="group";
String afilnet_method="getcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=getcontact | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppen-ID | Zwigend |
idcontact | Kontakt-ID | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
NOT_ACCESS_TO_CONTACT | ERROR_NOT_ACCESS_TO_CONTACT |
Kontakt zur Gruppe hinzufügen mit Java
String afilnet_class="group";
String afilnet_method="getcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
// 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="group";
String afilnet_method="addcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&contact="+afilnet_contact;
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="group";
String afilnet_method="addcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&contact="+afilnet_contact;
// 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="group";
String afilnet_method="addcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&contact="+afilnet_contact;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=addcontact | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
contact | Kontakt beizulegen mit die Felder bei Kommas getrennt, Beispiel versehen | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
CONTACT_EXISTS | Kontakt existiert jetzt in der Gruppe |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Kontaktliste zu einer Gruppe mit Java hinzufügen
String afilnet_class="group";
String afilnet_method="addcontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&contact="+afilnet_contact;
// 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="group";
String afilnet_method="addcontactlist";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contacts="[{\"name\":\"Test\",\"mobile\":\"34600000000\"},{\"name\":\"Test\",\"mobile\":\"34600000001\"}]";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&contacts="+afilnet_contacts;
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="group";
String afilnet_method="addcontactlist";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contacts="[{\"name\":\"Test\",\"mobile\":\"34600000000\"},{\"name\":\"Test\",\"mobile\":\"34600000001\"}]";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&contacts="+afilnet_contacts;
// 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="group";
String afilnet_method="addcontactlist";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contacts="[{\"name\":\"Test\",\"mobile\":\"34600000000\"},{\"name\":\"Test\",\"mobile\":\"34600000001\"}]";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&contacts="+afilnet_contacts;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=addcontactlist | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppen-ID | Zwigend |
contacts | Kontaktliste im JSON-Format | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Kontakt der Gruppe ändern mit Java
String afilnet_class="group";
String afilnet_method="addcontactlist";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_contacts="[{\"name\":\"Test\",\"mobile\":\"34600000000\"},{\"name\":\"Test\",\"mobile\":\"34600000001\"}]";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&contacts="+afilnet_contacts;
// 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="group";
String afilnet_method="modifycontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create an URL request
String sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact+"&contact="+afilnet_contact;
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="group";
String afilnet_method="modifycontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact+"&contact="+afilnet_contact;
// 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="group";
String afilnet_method="modifycontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact+"&contact="+afilnet_contact;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=modifycontact | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
idcontact | Kontaktekennung | Zwigend |
contact | Kontakt hinzufügen mit die Felder per Kommas getrennt, Beispiel versehen | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Kontakt aus der Gruppe entfernen mit Java
String afilnet_class="group";
String afilnet_method="modifycontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
String afilnet_contact="mobile:123456789,name:testname";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact+"&contact="+afilnet_contact;
// 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="group";
String afilnet_method="deletecontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="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+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
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="group";
String afilnet_method="deletecontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
// 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="group";
String afilnet_method="deletecontact";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_idgroup="1000";
String afilnet_idcontact="1000";
// Create the POST request
String post = "class="+afilnet_class+"&method="+afilnet_method+"&idgroup="+afilnet_idgroup+"&idcontact="+afilnet_idcontact;
// 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 | Beschreibung | Zwigend / optional |
---|---|---|
class=group | Sorte deren Antragen sich realisiert | Zwigend |
method=deletecontact | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
idgroup | Gruppenkennung | Zwigend |
idcontact | Kontaktekennung | Zwigend |
Antworten:
- Status
-
result (si status=success), Sie werden die nächsten Codes bekommen:
- Sie werden kein Grenzkosten bekommen
- Fehler (si status=Fehler), hier werden Sie der Fehlercode bekommen
Fehlercodes:
Code | Beschreibung |
---|---|
MISSING_USER | User / email nicht beiliegend |
MISSING_PASSWORD | Password nicht beiliegend |
MISSING_CLASS | Sorten nicht beiliegend |
MISSING_METHOD | Methode nicht beiliegend |
MISSING_COMPULSORY_PARAM | Parameterversicherung nicht beiliegend |
INCORRECT_USER_PASSWORD | User oder Passwort inkorrekt |
INCORRECT_CLASS | Inkorrekt Sorte |
INCORRECT_METHOD | Inkorrekt Methode |
NOT_ACCESS_TO_GROUP | Sie verfügt nicht auf die Erlaubnis für die geeignet Gruppe |
Welche API für Java soll ich verwenden?
Entdecken Sie die Vor- und Nachteile jeder unserer APIs. Finden Sie heraus, welche API für Ihre Software in Java am besten geeignet ist.
Mit dieser API können Sie von Java aus eine Verbindung zu uns herstellen, um Anfragen über HTTP GET-Anfragen zu senden. Diese Anfrage sendet die Parameter in derselben URL wie die Anfrage.
- HTTP GET ist extrem einfach zu implementieren
- Informationen werden unverschlüsselt gesendet (Passwörter können aus Protokollen oder Cache extrahiert werden)
- Maximale Anfrage von ~4000 Zeichen
Mit der POST-Anfrage-API können Sie von Java aus eine Verbindung zu unserer API herstellen, indem Sie Anfrageparameter über HTTP-POST-Parameter senden. Die Informationen werden unabhängig von der URL gesendet.
- HTTP POST ist einfach zu implementieren
- Informationen werden verschlüsselt gesendet
- Die Größe der Anfrage ist unbegrenzt
- Mittlere Sicherheit
Die grundlegende Authentifizierungs-API ermöglicht die Verwendung von GET- und POST-Anfragen in Java mit einer zusätzlichen Sicherheitsschicht, da in diesem Fall der Benutzername und das Passwort im Header der Anfrage gesendet werden.
- Die Basisauthentifizierung ist einfach zu implementieren
- Zugangsdaten werden verschlüsselt gesendet
- Die Größenbeschränkung hängt von der Verwendung von GET oder POST ab
- Mittlere Sicherheit
SOAP ermöglicht es Ihnen, Anfragen im XML-Format mit Java zu senden, SOAP fügt API-Anfragen eine zusätzliche Sicherheitsebene hinzu.
- Die SOAP-Integration ist komplexer
- Informationen werden verschlüsselt gesendet
- Die Größe der Anfrage ist unbegrenzt
- Mittlere/hohe Sicherheit
Unsere JSON-API ermöglicht es Ihnen, Anfragen im JSON-Format mit Java zu senden, zusätzlich fügt diese API das oAuth 2.0-Protokoll zur Authentifizierung hinzu, mit dem Sie eine zusätzliche Sicherheitsebene hinzufügen können.
- Die JSON oAuth 2.0-Integration ist komplexer
- Informationen werden verschlüsselt gesendet
- Die Größe der Anfrage ist unbegrenzt
- Hohe Sicherheit
Verbinden Sie Java mit unserer KONTAKTE API
Registrieren Sie sich als Kunde
Um Zugriff auf die API zu haben, müssen Sie ein Afilnet-Kunde sein. Die Registrierung dauert einige Minuten.
Fordern Sie Ihre kostenlose Testversion an
Unser Unternehmen bietet Ihnen ein Testguthaben an, mit dem Sie mit der von Ihnen benötigten API testen können.
Integrieren Sie die API
Führen Sie die API-Integration mit der Programmiersprache Ihrer Wahl durch. Wenn Sie Fragen oder Anregungen zur API haben, kontaktieren Sie uns
Willkommen bei Afilnet!
Alles bereit! Hat es geschafft, seine Kommunikation mit Afilnet zu verbessern. Wir sind hier, um unsere API zu unterstützen, wenn Sie sie benötigen
Wenden Sie sich bei Fragen über die von uns angebotenen Kontaktmethoden an unser Team. Unser Team wird versuchen, Ihnen eine sofortige Lösung anzubieten und Ihnen bei der Integration unserer API in Ihre Software helfen.