API de fala para C Sharp
Envie chamadas de voz automatizadas com nossa API para C Sharp com facilidade e segurança. Experimente nossa API para C Sharp gratuitamente. Nossa equipe ajudará você a integrar a entrega de voz automatizada em seu aplicativo em C Sharp.
Funcionalidade da API de chamada automática
Enviar mensagem de voz com 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 | Descrição | Mandatório / Opcional |
|---|---|---|
| class=voice | Classe pedida: Classe à qual o pedido é requisitado | Mandatório |
| method=sendvoice | Método de classe requisitado: Método da classe à qual o pedido é requisitado | Mandatório |
| user | Utilizador e email da sua conta Afilnet | Mandatório |
| password | Password da sua conta Afilnet | Mandatório |
| to | Número do celular ou fixo para onde a chamada de voz será enviada | Mandatório |
| from | Remetente da chamada de voz, deve ser um número de telefone, se um remetente não aceito for incluído, a chamada de voz será enviada com um remetente desconhecido | Mandatório |
| message | Mensagem a ser reproduzida por voz em chamada de voz | Mandatório |
| scheduledatetime | Data e hora da remessa no formato aaaa-mm-dd hh:mm:ss | Opcional |
| language | Idioma no qual a chamada de voz será tocada, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| voice | Voz com a qual a chamada de voz será reproduzida, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| output | Formato de output do resultado | Opcional |
Responda:
- status
-
result (if status=success), aqui receberá os seguintes valores:
- messageid
- credits
- error (if status=error), aqui receberá o código de erro
Códigos de erro:
| Código | Descrição |
|---|---|
| MISSING_USER | Utilizador ou email não incluído |
| MISSING_PASSWORD | Password não incluída |
| MISSING_CLASS | Classe não incluída |
| MISSING_METHOD | Método não incluído |
| MISSING_COMPULSORY_PARAM | Parâmetro obrigatório não incluído |
| INCORRECT_USER_PASSWORD | Utilizador ou password incorretos |
| INCORRECT_CLASS | Classe incorreta |
| INCORRECT_METHOD | Método incorreto |
| NO_ROUTE_AVAILABLE | Não há caminhos disponíveis para o destino indicado |
| NO_CREDITS | O seu saldo é insuficiente |
Enviar voz da template com 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 | Descrição | Mandatório / Opcional |
|---|---|---|
| class=voice | Classe pedida: Classe à qual o pedido é requisitado | Mandatório |
| method=sendvoicefromtemplate | Método de classe requisitado: Método da classe à qual o pedido é requisitado | Mandatório |
| user | Utilizador e email da sua conta Afilnet | Mandatório |
| password | Password da sua conta Afilnet | Mandatório |
| to | Número do celular ou fixo para onde a chamada de voz será enviada | Mandatório |
| idtemplate | Identificador do modelo que contém a mensagem que a chamada de voz irá reproduzir | Mandatório |
| params | Parâmetros a serem substituídos no modelo para personalização de chamada de voz, cada {{parâmetro}} será substituído pelo valor atribuído | Opcional |
| scheduledatetime | Data e hora da remessa no formato aaaa-mm-dd hh:mm:ss | Opcional |
| language | Idioma no qual a chamada de voz será tocada, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| voice | Voz com a qual a chamada de voz será reproduzida, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| output | Formato de output do resultado | Opcional |
Responda:
- status
-
result (if status=success), aqui receberá os seguintes valores:
- messageid
- credits
- error (if status=error), aqui receberá o código de erro
Códigos de erro:
| Código | Descrição |
|---|---|
| MISSING_USER | Utilizador ou email não incluído |
| MISSING_PASSWORD | Password não incluída |
| MISSING_CLASS | Classe não incluída |
| MISSING_METHOD | Método não incluído |
| MISSING_COMPULSORY_PARAM | Parâmetro obrigatório não incluído |
| INCORRECT_USER_PASSWORD | Utilizador ou password incorretos |
| INCORRECT_CLASS | Classe incorreta |
| INCORRECT_METHOD | Método incorreto |
| NO_ROUTE_AVAILABLE | Não há caminhos disponíveis para o destino indicado |
| NO_CREDITS | O seu saldo é insuficiente |
| NOT_ACCESS_TO_TEMPLATE | Não tem acesso ao template indicado |
Enviar voz em massa com 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 | Descrição | Mandatório / Opcional |
|---|---|---|
| class=voice | Classe pedida: Classe à qual o pedido é requisitado | Mandatório |
| method=sendvoicetogroup | Método de classe requisitado: Método da classe à qual o pedido é requisitado | Mandatório |
| user | Utilizador e email da sua conta Afilnet | Mandatório |
| password | Password da sua conta Afilnet | Mandatório |
| from | Remetente da chamada de voz, deve ser um número de telefone, se um remetente não aceito for incluído, a chamada de voz será enviada com um remetente desconhecido | Mandatório |
| countrycode | Prefixo do país | Mandatório |
| idgroup | Identificador de grupo contendo os contatos para os quais a chamada de voz será enviada | Mandatório |
| message | Mensagem a ser reproduzida por voz em chamada de voz | Mandatório |
| language | Idioma no qual a chamada de voz será tocada, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| voice | Voz com a qual a chamada de voz será reproduzida, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| scheduledatetime | Data e hora da remessa no formato aaaa-mm-dd hh:mm:ss | Opcional |
| output | Formato de output do resultado | Opcional |
Responda:
- status
-
result (if status=success), aqui receberá os seguintes valores:
- id
- count
- credits
-
destinations
- messageid
- destination
- error (if status=error), aqui receberá o código de erro
Códigos de erro:
| Código | Descrição |
|---|---|
| MISSING_USER | Utilizador ou email não incluído |
| MISSING_PASSWORD | Password não incluída |
| MISSING_CLASS | Classe não incluída |
| MISSING_METHOD | Método não incluído |
| MISSING_COMPULSORY_PARAM | Parâmetro obrigatório não incluído |
| INCORRECT_USER_PASSWORD | Utilizador ou password incorretos |
| INCORRECT_CLASS | Classe incorreta |
| INCORRECT_METHOD | Método incorreto |
| NOT_ACCESS_TO_GROUP | Não tem acesso ao grupo indicado |
| NO_CREDITS | O seu saldo é insuficiente |
Enviar voz em massa a partir da template com 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 | Descrição | Mandatório / Opcional |
|---|---|---|
| class=voice | Classe pedida: Classe à qual o pedido é requisitado | Mandatório |
| method=sendvoicetogroupfromtemplate | Método de classe requisitado: Método da classe à qual o pedido é requisitado | Mandatório |
| user | Utilizador e email da sua conta Afilnet | Mandatório |
| password | Password da sua conta Afilnet | Mandatório |
| countrycode | voice.sendvoicetogroupfromtemplate_countrycode | Mandatório |
| idgroup | Identificador de grupo contendo os contatos para os quais a chamada de voz será enviada | Mandatório |
| idtemplate | Identificador do modelo que contém a mensagem que a chamada de voz irá reproduzir | Mandatório |
| scheduledatetime | Data e hora da remessa no formato aaaa-mm-dd hh:mm:ss | Opcional |
| language | Idioma no qual a chamada de voz será tocada, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| voice | Voz com a qual a chamada de voz será reproduzida, verifique a tabela anexa para ver os valores disponíveis | Opcional |
| output | Formato de output do resultado | Opcional |
Responda:
- status
-
result (if status=success), aqui receberá os seguintes valores:
- id
- count
- credits
-
destinations
- messageid
- destination
- error (if status=error), aqui receberá o código de erro
Códigos de erro:
| Código | Descrição |
|---|---|
| MISSING_USER | Utilizador ou email não incluído |
| MISSING_PASSWORD | Password não incluída |
| MISSING_CLASS | Classe não incluída |
| MISSING_METHOD | Método não incluído |
| MISSING_COMPULSORY_PARAM | Parâmetro obrigatório não incluído |
| INCORRECT_USER_PASSWORD | Utilizador ou password incorretos |
| INCORRECT_CLASS | Classe incorreta |
| INCORRECT_METHOD | Método incorreto |
| NOT_ACCESS_TO_GROUP | Não tem acesso ao grupo indicado |
| NO_CREDITS | O seu saldo é insuficiente |
Obter estado de entrega de mensagem de voz com 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 | Descrição | Mandatório / Opcional |
|---|---|---|
| class=voice | Classe pedida: Classe à qual o pedido é requisitado | Mandatório |
| method=getdeliverystatus | Método de classe requisitado: Método da classe à qual o pedido é requisitado | Mandatório |
| user | Utilizador e email da sua conta Afilnet | Mandatório |
| password | Password da sua conta Afilnet | Mandatório |
| messages | voice.getdeliverystatus_messages | Mandatório |
| output | Formato de output do resultado | Opcional |
Responda:
- status
-
result (if status=success), aqui receberá os seguintes valores:
- messageid
- sms
- deliverydate
- deliverystatus
- error (if status=error), aqui receberá o código de erro
Códigos de erro:
| Código | Descrição |
|---|---|
| MISSING_USER | Utilizador ou email não incluído |
| MISSING_PASSWORD | Password não incluída |
| MISSING_CLASS | Classe não incluída |
| MISSING_METHOD | Método não incluído |
| MISSING_COMPULSORY_PARAM | Parâmetro obrigatório não incluído |
| INCORRECT_USER_PASSWORD | Utilizador ou password incorretos |
| INCORRECT_CLASS | Classe incorreta |
| INCORRECT_METHOD | Método incorreto |
Obter lista de vozes com 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 | Descrição | Mandatório / Opcional |
|---|---|---|
| class=voice | Classe pedida: Classe à qual o pedido é requisitado | Mandatório |
| method=getdeliverystatus | Método de classe requisitado: Método da classe à qual o pedido é requisitado | Mandatório |
| user | Utilizador e email da sua conta Afilnet | Mandatório |
| password | Password da sua conta Afilnet | Mandatório |
| lang | linguagem de voz | Opcional |
Responda:
- status
-
result (if status=success), aqui receberá os seguintes valores:
- lang
- gender
- name
- default
- error (if status=error), aqui receberá o código de erro
Códigos de erro:
| Código | Descrição |
|---|---|
| MISSING_USER | Utilizador ou email não incluído |
| MISSING_PASSWORD | Password não incluída |
| MISSING_CLASS | Classe não incluída |
| MISSING_METHOD | Método não incluído |
| MISSING_COMPULSORY_PARAM | Parâmetro obrigatório não incluído |
| INCORRECT_USER_PASSWORD | Utilizador ou password incorretos |
| INCORRECT_CLASS | Classe incorreta |
| INCORRECT_METHOD | Método incorreto |
ANEXO: Lista de idiomas e vozes para chamadas de voz disponíveis
Neste anexo você encontrará todas as combinações possíveis de idiomas e vozes que você pode usar ao enviar mensagens de chamada de voz
| Língua (Linguagem) | Gênero | Nome (voz) |
|---|---|---|
| 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 | Naja |
| da | male | Mads |
| da | female | Helle |
| de | female | Angela |
| de | male | Hans |
| de | female | Vicki |
| de | female | Hedda |
| de | male | Stefan |
| de | female | Marlene |
| de-at | male | Michael |
| de-ch | male | Karsten |
| el | female | Sophia |
| el | male | Stefanos |
| el | female | Afroditi |
| en | female | Jane |
| en | female | Zira |
| en | female | Jessica |
| en | female | Joanna |
| en | male | Joey |
| en | male | Justin |
| en | female | Kendra |
| en | female | Kimberly |
| en | male | Matthew |
| 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 | Hazel |
| en-gb | male | George |
| en-gb | female | Rosie |
| en-gb | female | Emma |
| en-gb | female | Amy |
| en-gb | male | Brian |
| 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 | male | Enrique |
| es | female | Penelope |
| es | female | Lupe |
| es | female | Laura |
| es | female | Linda |
| es | male | Miguel |
| es | male | Pablo |
| es-cl | female | Francisca |
| es-mx | male | Raul |
| es-mx | female | Hilda |
| es-mx | female | Mia |
| fi | female | Evelin |
| fi | female | Milla |
| fi | female | Heidi |
| fr | male | Mathieu |
| fr | male | Picart |
| fr | female | Juliette |
| fr | female | Celine |
| fr | female | Hortense |
| fr | female | Lea |
| fr-ca | female | Harmonie |
| fr-ca | female | Chantal |
| fr-ca | female | Caroline |
| fr-ch | male | Guillaume |
| gu | female | Leela |
| gu | male | Dinesh |
| he | male | Asaf |
| hi | male | Hemant |
| hi | female | Kalpana |
| hi | female | Aadita |
| hr | male | Matej |
| hu | male | Szabolcs |
| id | female | Nurul |
| id | male | Reza |
| id | female | Indah |
| id | male | Arif |
| id | male | Andika |
| is | female | Dora |
| is | male | Karl |
| it | female | Gianna |
| it | female | Carla |
| it | male | Giorgio |
| it | female | Bianca |
| ja | male | Takumi |
| ja | female | Mizuki |
| ja | male | Ichiro |
| ja | female | Haruka |
| ja | female | Ayumi |
| kn | female | Namratha |
| kn | male | Shashank |
| ko | female | Heami |
| ko | female | Seoyeon |
| ko | female | Yumi |
| ko | female | Sumi |
| ko | female | Jina |
| ko | male | Himchan |
| ko | male | Minho |
| 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 | female | Heloisa |
| pt-br | male | Ricardo |
| 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 |

Qual API para C Sharp devo usar?
Descubra as vantagens e desvantagens de cada uma das nossas APIs. Descubra qual API é melhor para o seu Software em C Sharp.
Essa API permite que você se conecte a nós de C Sharp para enviar solicitações por meio de solicitações HTTP GET. Essa solicitação envia os parâmetros na mesma URL da solicitação.
- HTTP GET é extremamente simples de implementar
- As informações são enviadas sem criptografia (as senhas podem ser extraídas de logs ou cache)
- Solicitação máxima de aproximadamente 4.000 caracteres
A API de solicitação POST permite que você se conecte à nossa API de C Sharp enviando parâmetros de solicitação por meio de parâmetros HTTP POST. As informações são enviadas independentemente da URL.
- HTTP POST é simples de implementar
- As informações são enviadas criptografadas
- Não há limite para o tamanho da solicitação
- Segurança média
A API de autenticação básica permite o uso de solicitações GET e POST em C Sharp com uma camada de segurança adicional, pois neste caso o nome de usuário e a senha são enviados no cabeçalho da solicitação.
- A autenticação básica é fácil de implementar
- Os dados de acesso são enviados criptografados
- O limite de tamanho depende do uso de GET ou POST
- Segurança média
SOAP permite enviar solicitações em formato XML com C Sharp, SOAP adiciona uma camada extra de segurança às solicitações de API.
- A integração SOAP é mais complexa
- As informações são enviadas criptografadas
- Não há limite para o tamanho da solicitação
- Segurança média/alta
Nossa API JSON permite enviar solicitações em formato JSON com C Sharp, além disso, essa API adiciona o protocolo oAuth 2.0 na autenticação que permite adicionar uma camada adicional de segurança.
- A integração JSON oAuth 2.0 é mais complexa
- As informações são enviadas criptografadas
- Não há limite para o tamanho da solicitação
- Alta seguranca
Conecte C Sharp com nossa API TEXTS-TO-SPEECH
Registre-se como um cliente
Para ter acesso à API você deve ser um cliente Afilnet. O registro levará alguns minutos.
Solicite sua avaliação gratuita
Nossa empresa lhe oferecerá um balancete que lhe permitirá testar com a API que você precisa.
Integrar a API
Realize a integração da API usando a linguagem de programação de sua escolha. Se você tiver dúvidas ou sugestões sobre a API, entre em contato conosco
Bem vindo ao Afilnet!
Tudo pronto!, conseguiu melhorar as suas comunicações com a Afilnet. Estamos aqui para dar suporte à nossa API quando você precisar
Em caso de dúvidas, entre em contato com nossa equipe através dos meios de contato que oferecemos. Nossa equipe tentará lhe oferecer uma solução imediata e lhe ajudará na integração de nossa API em seu Software.














