Διαγράψτε μια επαφή από μια ομάδα με Android
Διαγραφή ομάδας επαφών με Android
Android : ΕΓΓΡΑΦΗ API
- Δημιουργία ομάδας με Android
- Λήψη λίστας πεδίων ομάδας με Android
- Προσθέστε ένα πεδίο σε μια ομάδα με Android
- Διαγραφή πεδίου από ομάδα με Android
- Διαγράψτε μια επαφή από μια ομάδα
- Αναθέτοντας τη χώρα σε ομάδα e με Android
- Λήψη λίστας επαφών ομάδας με Android
- Προσθήκη επαφής σε μια ομάδα με Android
- Τροποποίηση επαφής ομάδας με Android
- Διαγραφή επαφής ομάδας με Android
- Λάβετε μια λίστα με ενεργά κανάλια συνομιλίας με Android
- Στείλτε ένα μήνυμα μέσω συνομιλίας με Android
- Στείλτε ένα αρχείο μέσω συνομιλίας με Android
- Λάβετε μια λίστα συνομιλιών σε μια συνομιλία με Android
- Λήψη λίστας μηνυμάτων από μια συνομιλία με Android
- Λάβετε μια λίστα μη αναγνωσμένων μηνυμάτων από μια συνομιλία με Android
Διαγράψτε μια επαφή από μια ομάδα με Android
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());
}
Παράμετρος | Περιγραφή | Υποχρεωτικό / Προαιρετικό |
---|---|---|
class=group | Αιτούμενη κλάση: Η κλάση στην οποία υποβάλλεται η αίτηση | Υποχρεωτικός |
method=deletegroup | Απαιτείται μέθοδος κλάσης: Μέθοδος της κλάσης στην οποία υποβάλλεται η αίτηση | Υποχρεωτικός |
user | Χρήστη και ηλεκτρονικό ταχυδρομείο του λογαριασμού σας Afilnet | Υποχρεωτικός |
password | Κωδικός πρόσβασης του λογαριασμού σας στο Afilnet | Υποχρεωτικός |
idgroup | Αναγνωριστικό ομάδας | Υποχρεωτικός |
Όταν υποβάλλετε αιτήματα, θα λάβετε τα ακόλουθα πεδία:
- status
-
αποτέλεσμα (εάν η κατάσταση = επιτυχία), εδώ θα λάβετε τις ακόλουθες τιμές:
- Δεν θα σας αποσταλούν πρόσθετες τιμές
- σφάλμα (αν κατάσταση = σφάλμα), εδώ θα λάβετε τον κωδικό σφάλματος
Οι πιθανοί κωδικοί σφαλμάτων παρατίθενται παρακάτω
Κώδικας | Περιγραφή |
---|---|
MISSING_USER | Ο χρήστης ή το ηλεκτρονικό ταχυδρομείο δεν περιλαμβάνονται |
MISSING_PASSWORD | Ο κωδικός πρόσβασης δεν περιλαμβάνεται |
MISSING_CLASS | Η κατηγορία δεν περιλαμβάνεται |
MISSING_METHOD | Η μέθοδος δεν περιλαμβάνεται |
MISSING_COMPULSORY_PARAM | Η υποχρεωτική παράμετρος δεν περιλαμβάνεται |
INCORRECT_USER_PASSWORD | Λανθασμένος χρήστης ή κωδικός πρόσβασης |
INCORRECT_CLASS | Λανθασμένη κλάση |
INCORRECT_METHOD | Εσφαλμένη μέθοδος |
NOT_ACCESS_TO_GROUP | Δεν επιτρέπεται η είσοδος στην υποδεικνυόμενη ομάδα |
Παράμετροι:
- class : group
- method : deletegroup
- user : user
- password : password
- idgroup : 1000
Αίτηση:
https://www.afilnet.com/api/http/?class=group&method=deletegroup&user=user&password=password&idgroup=1000