API de Voz para C Sharp
Envíe llamadas de voz automáticas con nuestra API para C Sharp de forma sencilla y segura. Pruebe gratis nuestra API para C Sharp. Nuestro equipo le ayudará a integrar el envío automatizado de voz en su aplicación en C Sharp.

Funcionalidad de la API de llamada automática
Enviar mensaje de voz con C Sharp
String afilnet_class="voice";
String afilnet_method="sendvoice";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_to="34600000000";
String afilnet_from="34900000000";
String afilnet_message="voice+test";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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+"&to="+afilnet_to+"&from="+afilnet_from+"&message="+afilnet_message+"&scheduledatetime="+afilnet_scheduledatetime+"&language="+afilnet_language+"&voice="+afilnet_voice+"&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"] = "voice";
data["method"] = "sendvoice";
data["user"] = "user";
data["password"] = "password";
data["to"] = "34600000000";
data["from"] = "34900000000";
data["message"] = "voice+test";
data["scheduledatetime"] = "";
data["language"] = "en";
data["voice"] = "Joanna";
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"] = "voice";
data["method"] = "sendvoice";
data["to"] = "34600000000";
data["from"] = "34900000000";
data["message"] = "voice+test";
data["scheduledatetime"] = "";
data["language"] = "en";
data["voice"] = "Joanna";
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/basic/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="voice";
String afilnet_method="sendvoice";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_to="34600000000";
String afilnet_from="34900000000";
String afilnet_message="voice+test";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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, "{\"to\":\""+afilnet_to+"\",\"from\":\""+afilnet_from+"\",\"message\":\""+afilnet_message+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"output\":\""+afilnet_output+"\"}");
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=voice | Clase a la que se realiza la petición | Obligatorio |
method=sendvoice | 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 |
to | Número móvil o fijo a donde se enviará la llamada de voz | Obligatorio |
from | Remitente de la llamada de voz, debe ser un número de teléfono, en caso de que se incluya un remitente no aceptado se enviará la llamada de voz con remitente desconocido | Obligatorio |
message | Mensaje que se reproducirá por voz en la llamada de voz | Obligatorio |
scheduledatetime | Fecha y hora de envío en formato yyyy-mm-dd hh:mm:ss | Opcional |
language | Idioma en el que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
voice | Voz con la que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
output | Formato de salida del resultado | Opcional |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- messageid
- credits
- 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 |
NO_ROUTE_AVAILABLE | No hay rutas disponibles para el destino indicado |
NO_CREDITS | No dispone de saldo suficiente |
Enviar Voz desde plantilla con C Sharp
String afilnet_class="voice";
String afilnet_method="sendvoice";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_to="34600000000";
String afilnet_from="34900000000";
String afilnet_message="voice+test";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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, "{\"to\":\""+afilnet_to+"\",\"from\":\""+afilnet_from+"\",\"message\":\""+afilnet_message+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"output\":\""+afilnet_output+"\"}");String afilnet_class="voice";
String afilnet_method="sendvoicefromtemplate";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_to="34600000000";
String afilnet_idtemplate="1000";
String afilnet_params="mobile:123456789,name:test+name";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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+"&to="+afilnet_to+"&idtemplate="+afilnet_idtemplate+"¶ms="+afilnet_params+"&scheduledatetime="+afilnet_scheduledatetime+"&language="+afilnet_language+"&voice="+afilnet_voice+"&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"] = "voice";
data["method"] = "sendvoicefromtemplate";
data["user"] = "user";
data["password"] = "password";
data["to"] = "34600000000";
data["idtemplate"] = "1000";
data["params"] = "mobile:123456789,name:test+name";
data["scheduledatetime"] = "";
data["language"] = "en";
data["voice"] = "Joanna";
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"] = "voice";
data["method"] = "sendvoicefromtemplate";
data["to"] = "34600000000";
data["idtemplate"] = "1000";
data["params"] = "mobile:123456789,name:test+name";
data["scheduledatetime"] = "";
data["language"] = "en";
data["voice"] = "Joanna";
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/basic/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="voice";
String afilnet_method="sendvoicefromtemplate";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_to="34600000000";
String afilnet_idtemplate="1000";
String afilnet_params="mobile:123456789,name:test+name";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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, "{\"to\":\""+afilnet_to+"\",\"idtemplate\":\""+afilnet_idtemplate+"\",\"params\":\""+afilnet_params+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"output\":\""+afilnet_output+"\"}");
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=voice | Clase a la que se realiza la petición | Obligatorio |
method=sendvoicefromtemplate | 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 |
to | Número móvil o fijo a donde se enviará la llamada de voz | Obligatorio |
idtemplate | Identificador de la plantilla que contiene el mensaje que reproducirá la llamada de voz | Obligatorio |
params | Parámetros que se sustituirán en la plantilla para la personalización de la llamada de voz, cada {{parámetro}} se sustituirá por el valor asignado | Opcional |
scheduledatetime | Fecha y hora de envío en formato yyyy-mm-dd hh:mm:ss | Opcional |
language | Idioma en el que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
voice | Voz con la que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
output | Formato de salida del resultado | Opcional |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- messageid
- credits
- 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 |
NO_ROUTE_AVAILABLE | No hay rutas disponibles para el destino indicado |
NO_CREDITS | No dispone de saldo suficiente |
NOT_ACCESS_TO_TEMPLATE | No dispone acceso a la plantilla indicada |
Enviar Voz Masiva con C Sharp
String afilnet_class="voice";
String afilnet_method="sendvoicefromtemplate";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_to="34600000000";
String afilnet_idtemplate="1000";
String afilnet_params="mobile:123456789,name:test+name";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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, "{\"to\":\""+afilnet_to+"\",\"idtemplate\":\""+afilnet_idtemplate+"\",\"params\":\""+afilnet_params+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"output\":\""+afilnet_output+"\"}");String afilnet_class="voice";
String afilnet_method="sendvoicetogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_from="34900000000";
String afilnet_countrycode="34";
String afilnet_idgroup="1";
String afilnet_message="sms+test";
String afilnet_language="en";
String afilnet_voice="Joanna";
String afilnet_scheduledatetime="";
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+"&from="+afilnet_from+"&countrycode="+afilnet_countrycode+"&idgroup="+afilnet_idgroup+"&message="+afilnet_message+"&language="+afilnet_language+"&voice="+afilnet_voice+"&scheduledatetime="+afilnet_scheduledatetime+"&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"] = "voice";
data["method"] = "sendvoicetogroup";
data["user"] = "user";
data["password"] = "password";
data["from"] = "34900000000";
data["countrycode"] = "34";
data["idgroup"] = "1";
data["message"] = "sms+test";
data["language"] = "en";
data["voice"] = "Joanna";
data["scheduledatetime"] = "";
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"] = "voice";
data["method"] = "sendvoicetogroup";
data["from"] = "34900000000";
data["countrycode"] = "34";
data["idgroup"] = "1";
data["message"] = "sms+test";
data["language"] = "en";
data["voice"] = "Joanna";
data["scheduledatetime"] = "";
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/basic/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="voice";
String afilnet_method="sendvoicetogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_from="34900000000";
String afilnet_countrycode="34";
String afilnet_idgroup="1";
String afilnet_message="sms+test";
String afilnet_language="en";
String afilnet_voice="Joanna";
String afilnet_scheduledatetime="";
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, "{\"from\":\""+afilnet_from+"\",\"countrycode\":\""+afilnet_countrycode+"\",\"idgroup\":\""+afilnet_idgroup+"\",\"message\":\""+afilnet_message+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"output\":\""+afilnet_output+"\"}");
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=voice | Clase a la que se realiza la petición | Obligatorio |
method=sendvoicetogroup | 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 |
from | Remitente de la llamada de voz, debe ser un número de teléfono, en caso de que se incluya un remitente no aceptado se enviará la llamada de voz con remitente desconocido | Obligatorio |
countrycode | Prefijo del país | Obligatorio |
idgroup | Identificador del grupo que contiene los contactos a donde se enviará la llamada de voz | Obligatorio |
message | Mensaje que se reproducirá por voz en la llamada de voz | Obligatorio |
language | Idioma en el que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
voice | Voz con la que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
scheduledatetime | Fecha y hora de envío en formato yyyy-mm-dd hh:mm:ss | Opcional |
output | Formato de salida del resultado | Opcional |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- id
- count
- credits
-
destinations
- messageid
- destination
- 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 |
NO_CREDITS | No dispone de saldo suficiente |
Enviar Voz Masiva desde plantilla con C Sharp
String afilnet_class="voice";
String afilnet_method="sendvoicetogroup";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_from="34900000000";
String afilnet_countrycode="34";
String afilnet_idgroup="1";
String afilnet_message="sms+test";
String afilnet_language="en";
String afilnet_voice="Joanna";
String afilnet_scheduledatetime="";
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, "{\"from\":\""+afilnet_from+"\",\"countrycode\":\""+afilnet_countrycode+"\",\"idgroup\":\""+afilnet_idgroup+"\",\"message\":\""+afilnet_message+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"output\":\""+afilnet_output+"\"}");String afilnet_class="voice";
String afilnet_method="sendvoicetogroupfromtemplate";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_countrycode="34";
String afilnet_idgroup="1";
String afilnet_idtemplate="1000";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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+"&countrycode="+afilnet_countrycode+"&idgroup="+afilnet_idgroup+"&idtemplate="+afilnet_idtemplate+"&scheduledatetime="+afilnet_scheduledatetime+"&language="+afilnet_language+"&voice="+afilnet_voice+"&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"] = "voice";
data["method"] = "sendvoicetogroupfromtemplate";
data["user"] = "user";
data["password"] = "password";
data["countrycode"] = "34";
data["idgroup"] = "1";
data["idtemplate"] = "1000";
data["scheduledatetime"] = "";
data["language"] = "en";
data["voice"] = "Joanna";
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"] = "voice";
data["method"] = "sendvoicetogroupfromtemplate";
data["countrycode"] = "34";
data["idgroup"] = "1";
data["idtemplate"] = "1000";
data["scheduledatetime"] = "";
data["language"] = "en";
data["voice"] = "Joanna";
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/basic/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="voice";
String afilnet_method="sendvoicetogroupfromtemplate";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_countrycode="34";
String afilnet_idgroup="1";
String afilnet_idtemplate="1000";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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, "{\"countrycode\":\""+afilnet_countrycode+"\",\"idgroup\":\""+afilnet_idgroup+"\",\"idtemplate\":\""+afilnet_idtemplate+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"output\":\""+afilnet_output+"\"}");
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=voice | Clase a la que se realiza la petición | Obligatorio |
method=sendvoicetogroupfromtemplate | 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 |
countrycode | voice.sendvoicetogroupfromtemplate_countrycode | Obligatorio |
idgroup | Identificador del grupo que contiene los contactos a donde se enviará la llamada de voz | Obligatorio |
idtemplate | Identificador de la plantilla que contiene el mensaje que reproducirá la llamada de voz | Obligatorio |
scheduledatetime | Fecha y hora de envío en formato yyyy-mm-dd hh:mm:ss | Opcional |
language | Idioma en el que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
voice | Voz con la que se reproducirá la llamada de voz, revisar tabla anexa para ver valores disponibles | Opcional |
output | Formato de salida del resultado | Opcional |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- id
- count
- credits
-
destinations
- messageid
- destination
- 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 |
NO_CREDITS | No dispone de saldo suficiente |
Obtener estado de entrega de voz con C Sharp
String afilnet_class="voice";
String afilnet_method="sendvoicetogroupfromtemplate";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_countrycode="34";
String afilnet_idgroup="1";
String afilnet_idtemplate="1000";
String afilnet_scheduledatetime="";
String afilnet_language="en";
String afilnet_voice="Joanna";
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, "{\"countrycode\":\""+afilnet_countrycode+"\",\"idgroup\":\""+afilnet_idgroup+"\",\"idtemplate\":\""+afilnet_idtemplate+"\",\"scheduledatetime\":\""+afilnet_scheduledatetime+"\",\"language\":\""+afilnet_language+"\",\"voice\":\""+afilnet_voice+"\",\"output\":\""+afilnet_output+"\"}");String afilnet_class="voice";
String afilnet_method="getdeliverystatus";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_messages="123456,123457,123458";
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+"&messages="+afilnet_messages+"&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"] = "voice";
data["method"] = "getdeliverystatus";
data["user"] = "user";
data["password"] = "password";
data["messages"] = "123456,123457,123458";
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"] = "voice";
data["method"] = "getdeliverystatus";
data["messages"] = "123456,123457,123458";
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/basic/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="voice";
String afilnet_method="getdeliverystatus";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_messages="123456,123457,123458";
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, "{\"messages\":\""+afilnet_messages+"\",\"output\":\""+afilnet_output+"\"}");
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=voice | Clase a la que se realiza la petición | Obligatorio |
method=getdeliverystatus | 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 |
messages | voice.getdeliverystatus_messages | Obligatorio |
output | Formato de salida del resultado | Opcional |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- messageid
- sms
- deliverydate
- deliverystatus
- 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 |
Obtener listado de voces con C Sharp
String afilnet_class="voice";
String afilnet_method="getdeliverystatus";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_messages="123456,123457,123458";
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, "{\"messages\":\""+afilnet_messages+"\",\"output\":\""+afilnet_output+"\"}");String afilnet_class="voice";
String afilnet_method="getdeliverystatus";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_lang="en";
// 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+"&lang="+afilnet_lang);
// 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"] = "voice";
data["method"] = "getdeliverystatus";
data["user"] = "user";
data["password"] = "password";
data["lang"] = "en";
// 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"] = "voice";
data["method"] = "getdeliverystatus";
data["lang"] = "en";
// Create Web client
var wb = new WebClient { Credentials = new NetworkCredential("user", "password") };
// Execute POST petition
var response = wb.UploadValues("https://www.afilnet.com/api/basic/", "POST", data);
// Get response
string responseString = Encoding.UTF8.GetString(response);
String afilnet_class="voice";
String afilnet_method="getdeliverystatus";
String afilnet_user="user";
String afilnet_password="password";
String afilnet_lang="en";
// 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, "{\"lang\":\""+afilnet_lang+"\"}");
Parámetro | Descripción | Obligatorio / Opcional |
---|---|---|
class=voice | Clase a la que se realiza la petición | Obligatorio |
method=getdeliverystatus | 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 |
lang | Idioma de la voz | Opcional |
Respuesta:
- status
-
result (si status=success), recibirá los siguientes valores:
- lang
- gender
- name
- default
- 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 |
ANEXO: Listado de idiomas y voces para llamadas de voz disponibles
En este anexo podrá encontrar todas las posibles combinaciones de idiomas y voces que puede utilizara a la hora de enviar mensajes de llamadas de voz
Idioma (language) | Género | Nombre (voice) |
---|---|---|
ar | female | Hoda |
ar | male | Naayf |
ar | female | Zeina |
ar | female | Aisha |
ar | male | Farooq |
ar | male | Hussein |
ar | female | Amal |
bg | male | Ivan |
bn | female | Sushmita |
bn | male | Sayan |
ca | female | Conchita |
ca | female | Herena |
cs | male | Jakub |
da | female | Helle |
da | male | Mads |
da | female | Naja |
de | female | Angela |
de | male | Hans |
de | female | Vicki |
de | male | Stefan |
de | female | Marlene |
de | female | Hedda |
de-at | male | Michael |
de-ch | male | Karsten |
el | female | Afroditi |
el | male | Stefanos |
el | female | Sophia |
en | female | Jane |
en | female | Jessica |
en | female | Joanna |
en | male | Joey |
en | male | Justin |
en | female | Kendra |
en | female | Kimberly |
en | male | Matthew |
en | female | Zira |
en | female | Ivy |
en | male | Guy |
en | male | Benjamin |
en | female | Salli |
en-au | male | Russell |
en-au | female | Nicole |
en-au | female | Catherine |
en-au | female | Hayley |
en-ca | female | Heather |
en-ca | female | Alice |
en-gb | female | Rosie |
en-gb | female | Hazel |
en-gb | male | George |
en-gb | female | Emma |
en-gb | male | Brian |
en-gb | female | Amy |
en-gb-wls | male | Geraint |
en-ie | male | Sean |
en-in | male | Ravi |
en-in | female | Aditi |
en-in | female | Heera |
en-in | female | Priya |
en-in | female | Raveena |
es | female | Penelope |
es | male | Miguel |
es | female | Linda |
es | female | Laura |
es | male | Enrique |
es | female | Lupe |
es | male | Pablo |
es-cl | female | Francisca |
es-mx | female | Hilda |
es-mx | female | Mia |
es-mx | male | Raul |
fi | female | Milla |
fi | female | Evelin |
fi | female | Heidi |
fr | male | Picart |
fr | male | Mathieu |
fr | female | Juliette |
fr | female | Lea |
fr | female | Celine |
fr | female | Hortense |
fr-ca | female | Caroline |
fr-ca | female | Chantal |
fr-ca | female | Harmonie |
fr-ch | male | Guillaume |
gu | female | Leela |
gu | male | Dinesh |
he | male | Asaf |
hi | female | Kalpana |
hi | male | Hemant |
hi | female | Aadita |
hr | male | Matej |
hu | male | Szabolcs |
id | female | Indah |
id | male | Andika |
id | male | Reza |
id | female | Nurul |
id | male | Arif |
is | male | Karl |
is | female | Dora |
it | female | Lucia |
it | male | Cosimo |
it | female | Carla |
it | female | Bianca |
it | male | Giorgio |
it | female | Gianna |
ja | male | Ichiro |
ja | male | Takumi |
ja | female | Haruka |
ja | female | Ayumi |
ja | female | Mizuki |
kn | male | Shashank |
kn | female | Namratha |
ko | male | Minho |
ko | male | Himchan |
ko | female | Jina |
ko | female | Sumi |
ko | female | Yumi |
ko | female | Seoyeon |
ko | female | Heami |
ml | female | Kirti |
ml | male | Vishnu |
ms | male | Rizwan |
nl | male | Ruben |
nl | female | Lotte |
nl | female | Hanna |
no | female | Liv |
no | female | Hulda |
pl | male | Jacek |
pl | female | Ewa |
pl | male | Jan |
pl | female | Paulina |
pl | female | Maja |
pt-br | female | Camila |
pt-br | male | Daniel |
pt-br | female | Vitoria |
pt-br | male | Ricardo |
pt-br | female | Heloisa |
pt-pt | female | Abrielle |
pt-pt | female | Jacinda |
pt-pt | male | Jeraldo |
pt-pt | male | Henriques |
pt-pt | female | Ines |
pt-pt | female | Helia |
pt-pt | male | Cristiano |
pt-pt | female | Amalia |
ro | female | Carmen |
ro | male | Andrei |
ru | female | Ekaterina |
ru | female | Irina |
ru | male | Pavel |
ru | female | Tatyana |
ru | male | Maxim |
sk | male | Filip |
sl | male | Lado |
sv | female | Astrid |
sv | female | Hedvig |
ta | female | Shruti |
ta | male | Valluvar |
ta | male | Ganesh |
te | male | Vijay |
te | female | Samantha |
te | female | Chitra |
th | male | Pattara |
th | female | Somsi |
tr | female | Filiz |
tr | female | Seda |
vi | female | Lien |
vi | male | Quan |
vi | male | An |
vi | male | Thao |
vi | female | Mai |
wls | female | Gwyneth |
zh-cn | female | Lin |
zh-cn | female | Akemi |
zh-cn | female | Liu |
zh-cn | male | Wang |
zh-cn | male | Huang |
zh-cn | male | Chen |
zh-cn | female | Zhiyu |
zh-cn | female | Yaoyao |
zh-cn | female | Lily |
zh-cn | male | Kangkang |
zh-cn | female | Huihui |
zh-cn | male | Zhang |
zh-tw | female | Yating |
zh-tw | male | Zhiwei |
zh-tw | female | Hanhan |

¿Qué API para C Sharp debo utilizar?
Descubra las ventajas e inconvenientes de cada una de nuestras APIs. Descubra cual API es mejor para su Software en C Sharp.
Esta API permite conectar con nosotros desde C Sharp 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 C Sharp 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 C Sharp 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 C Sharp, 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 C Sharp, 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 C Sharp con nuestra API de LLAMADAS DE VOZ
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.