Contactos API
Gestione sus grupos (cree, modifique o elimine grupos) y contactos con nuestra API para contactos.

Crear grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=creategroup | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
name | Nombre del grupo | Obligatorio |
type | Tipo de grupo (email o mobile) | Obligatorio |
fields | Listado de campos separados por comas, obligatorio incluir un campo movil si tipo = mobile y un campo email si tipo = email | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
INCORRECT_TYPE | Tipo incorrecto, debe ser mobile o email |
MISSING_MAIN_FIELD | Falta el campo principal (mobile si tipo = mobile o email si tipo = email) |
Obtener campos de un grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=getgroupcolumns | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Añadir campo a un grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=addcolumntogroup | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
field | Campo del grupo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Elimina campo de un grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=deletecolumnfromgroup | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
field | Campo del grupo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Eliminar un grupo de contactos con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=deletegroup | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Asigna país a un grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=assigncountrytogroup | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
countryiso3 | Código ISO del país | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
COUNTRY_NOT_FOUND | No existe ningún país con el código indicado |
Obtener contactos del grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=getcontacts | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Obtener un contacto de un grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=getcontact | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | ID del grupo | Obligatorio |
idcontact | ID del contacto | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
NOT_ACCESS_TO_CONTACT | ERROR_NOT_ACCESS_TO_CONTACT |
Añadir contacto a grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=addcontact | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
contact | Contacto a añadir con los campos separados por comas, ver ejemplo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
CONTACT_EXISTS | Contacto ya existe en el grupo |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Añadir una lista de contactos a un grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=addcontactlist | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | ID del grupo | Obligatorio |
contacts | Lista de contactos en formato JSON | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Modificar contacto del grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=modifycontact | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
idcontact | Identificador del contacto | Obligatorio |
contact | Contacto a añadir con los campos separados por comas, ver ejemplo | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |
Eliminar contacto del grupo con Android
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());
}
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=group | Clase a la que se realiza la petición | Obligatorio |
method=deletecontact | Método de la clase al que se realiza la petición | Obligatorio |
user | El usuario / email de su cuenta de Afilnet | Obligatorio |
password | El password de su cuenta de Afilnet | Obligatorio |
idgroup | Identificador del grupo | Obligatorio |
idcontact | Identificador del contacto | Obligatorio |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- No recibirá valores adicionales
- error (si status=error), aquí recibirá el código de error
Códigos de error:
Código | Descripción |
---|---|
MISSING_USER | Usuario / email no incluido |
MISSING_PASSWORD | Password no incluido |
MISSING_CLASS | Clase no incluida |
MISSING_METHOD | Método no incluido |
MISSING_COMPULSORY_PARAM | Parámetro obligatorio no incluido |
INCORRECT_USER_PASSWORD | Usuario o clave incorrectos |
INCORRECT_CLASS | Clase incorrecta |
INCORRECT_METHOD | Método incorrecto |
NOT_ACCESS_TO_GROUP | No dispone de permisos al grupo indicado |

¿Qué API para Android debo utilizar?
Descubra las ventajas e inconvenientes de cada una de nuestras APIs. Descubra cual API es mejor para su Software en Android.
Esta API permite conectar con nosotros desde Android para enviar peticiones a través de peticiones HTTP GET. Esta petición envía los parámetros en la misma URL de la petición.
- HTTP GET es extremadamente sencillo de implementar
- Información se envía no cifrada (Se podría extraer contraseñas de logs o caché)
- Petición máximas de ~4000 caracteres
La API de peticiones POST le permite conectar con nuestra API desde Android enviando los parámetros de la petición por parámetros HTTP POST. La información se envía de forma independiente a la URL.
- HTTP POST es sencillo de implementar
- Información se envía cifrada
- No hay limite en el tamaño de la petición
- Seguridad media
La API de autenticación básica permite la utilización de peticiones GET y POST en Android con una capa de seguridad adicional, ya que en este caso el usuario y clave se envía en la cabecera de la petición.
- La autenticación básica es sencilla de implementar
- Datos de acceso se envían cifrados
- El límite del tamaño depende del uso de GET o POST
- Seguridad media
SOAP le permite enviar peticiones en formato XML con Android, SOAP añade capa de seguridad extra en las peticiones API.
- La integración SOAP es más compleja
- Información se envía cifrada
- No hay limite en el tamaño de la petición
- Seguridad media / alta
Nuestra API JSON le permite enviar peticiones en formato JSON con Android, además esta API añade el protocolo oAuth 2.0 en la autenticación que le permite añadir una capa adicional de seguridad.
- La integración JSON oAuth 2.0 es más compleja
- Información se envía cifrada
- No hay limite en el tamaño de la petición
- Seguridad alta
Conectar Android con nuestra API de CONTACTOS
Regístrese como cliente
Para poder tener acceso a la API debe ser cliente de Afilnet. El registro le llevará pocos minutos.
Solicite su prueba gratuita
Nuestra empresa le ofrecerá saldo de prueba que le permitirá realizar las pruebas con la API que necesite.
Integre la API
Realice la integración de la API utilizando el lenguaje de programación que deseen. Si tiene alguna duda o sugerencía sobre la API contáctenos
¡Bienvenido a Afilnet!
¡Todo listo!, ha conseguido mejorar sus comunicaciones con Afilnet. Estamos para darle soporte de nuestra API cuando lo necesite
Contacte con nuestro equipo a través de cualquiera duda a través de los métodos de contacto que le ofrecemos. Nuestro equipo intentará ofrecerla una solución inmediata y le ayudará en la integración de nuestra API en su Software.