OTP mit C Sharp
Erzeugen eines OTP-Token-Codes (One Time Password) mit C Sharp
C Sharp : API-DOKUMENTATION
- Gruppe anlegen mit C Sharp
- Felder aus einer Gruppe abrufen mit C Sharp
- Feld zu einer Gruppe hinzufügen mit C Sharp
- Feld aus einer Gruppe entfernen mit C Sharp
- Einen Kontakt aus einer Gruppe löschen
- Land einer Gruppe zuordnen mit C Sharp
- Kontakte der Gruppe abrufen mit C Sharp
- Kontakt zur Gruppe hinzufügen mit C Sharp
- Kontakt der Gruppe ändern mit C Sharp
- Kontakt aus der Gruppe entfernen mit C Sharp
- Holen Sie sich eine Liste der aktiven Chat-Kanäle mit C Sharp
- Senden Sie eine Nachricht per Chat mit C Sharp
- Senden Sie eine Datei per Chat mit C Sharp
- Holen Sie sich eine Liste der Konversationen in einem Chat mit C Sharp
- Liste der Nachrichten aus einem Chat mit C Sharp abrufen
- Holen Sie sich eine Liste ungelesener Nachrichten aus einem Chat mit C Sharp
- Senden Sie eine Nachricht von WhatsAPP mit C Sharp
- Senden Sie eine Datei von WhatsAPP mit C Sharp
- Holen Sie sich eine Liste der WhatsAPP-Konversationen mit C Sharp
- Holen Sie sich eine Liste der WhatsAPP-Nachrichten mit C Sharp
- Holen Sie sich eine Liste ungelesener Nachrichten aus einem WhatsAPP-Chat mit C Sharp
OTP mit C Sharp
String afilnet_class="otp";
String afilnet_method="generateotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_type="number";
String afilnet_destination="34600000000";
String afilnet_time="1";
String afilnet_timetype="days";
String afilnet_length="6";
String afilnet_otpformat="all";
String afilnet_output="";
// Create an URL request
WebRequest request = WebRequest.Create("https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&type="+afilnet_type+"&destination="+afilnet_destination+"&time="+afilnet_time+"&timetype="+afilnet_timetype+"&length="+afilnet_length+"&otpformat="+afilnet_otpformat+"&output="+afilnet_output);
// Get the response
WebResponse response = request.GetResponse ();
// Get the stream returned by the server
Stream dataStream = response.GetResponseStream();
// Open the stream
StreamReader reader = new StreamReader (dataStream);
// Read the Response
String result = reader.ReadToEnd ();
// Asign vars
var data = new NameValueCollection();
data["class"] = "otp";
data["method"] = "generateotp";
data["user"] = "user";
data["password"] = "password";
data["type"] = "number";
data["destination"] = "34600000000";
data["time"] = "1";
data["timetype"] = "days";
data["length"] = "6";
data["otpformat"] = "all";
data["output"] = "";
// Create Web client
var wb = new WebClient();
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/http/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
// Asign vars
var data = new NameValueCollection();
data["class"] = "otp";
data["method"] = "generateotp";
data["type"] = "number";
data["destination"] = "34600000000";
data["time"] = "1";
data["timetype"] = "days";
data["length"] = "6";
data["otpformat"] = "all";
data["output"] = "";
// Create Web client
var wb = new WebClient { Credentials = new NetworkCredential("user", "password") };
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/http/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="otp";
String afilnet_method="generateotp";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_type="number";
String afilnet_destination="34600000000";
String afilnet_time="1";
String afilnet_timetype="days";
String afilnet_length="6";
String afilnet_otpformat="all";
String afilnet_output="";
// Allow SSL/TLS config
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// We create the webservice instance (Register Web Service first in project)
var service = new WebService.ApplicationServicesPortTypeClient();
// Call to WebService method
String response = service.call(afilnet_user, afilnet_password, afilnet_class, afilnet_method, "{\"type\":\""+afilnet_type+"\",\"destination\":\""+afilnet_destination+"\",\"time\":\""+afilnet_time+"\",\"timetype\":\""+afilnet_timetype+"\",\"length\":\""+afilnet_length+"\",\"otpformat\":\""+afilnet_otpformat+"\",\"output\":\""+afilnet_output+"\"}");
Parameter | Beschreibung | Zwigend / optional |
---|---|---|
class=otp | Sorte deren Antragen sich realisiert | Zwigend |
method=generateotp | Sortenmethode deren Antragen sich realisiert | Zwigend |
user | Der User / Email Ihres Afilnet Account | Zwigend |
password | Das password Ihres Afilnet Account | Zwigend |
type | Art von Gruppe (Email oder Handy) | Zwigend |
destination | Handynummer oder Bestimmung Email | Zwigend |
time | Nummer con Tage, Wochen, Monates oder Jahres | Optional |
timetype | Art von Zeit (Mögliche Werte : Tages, Wochen, Monate oder Jahres) | Optional |
length | Länge auf das Passwort zu erzeugen | Optional |
otpformat | Format auf das Passwort zu erzeugen, ob es beinhalt alle der Zeichen, nur Nummern oder nur Buchstaben (alle, Nummern, Buchstaben) | Optional |
output | Ergebnisse Ausgabeformat | Optional |
Aus Sie die Anfragen verwenden,werden Sie die nächster Datenfeld bekommen:
- 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
Die mögliche Fehlercode sind die nächster:
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_TIME_TYPE | Inkorrekt Zeittyp (Mögliche Valeurs: minutes, hours, days, weeks, months oder years) |
INCORRECT_TYPE | Inkorrekt Type, es must mobile oder Email zu sein |
INCORRECT_FORMAT | ERROR_INCORRECT_FORMAT |
INCORRECT_OTP_FORMAT | ERROR_INCORRECT_OTP_FORMAT |
Parameter:
- class : otp
- method : generateotp
- user : user
- password : password
- type : number
- destination : 34600000000
- time : 1
- timetype : days
- length : 6
- otpformat : all
- output :
Anforderung:
https://www.afilnet.com/api/http/?class=otp&method=generateotp&user=user&password=password&type=number&destination=34600000000&time=1&timetype=days&length=6&otpformat=all&output=