totalvoice csharp
Versão 1.2.1
TotalVoice의 API의 경우 클라이언트 C#
기능
사전 요구 사항
사용
이 라이브러리를 사용하려면 먼저 Total Voice 웹 사이트에 등록해야합니다. 등록을 마친 후 API에 액세스 할 수있는 액세서로 골을 사용할 수 있습니다.
AccessStoken을 사용하면 API 문서에 따라 상담/등록을 할 수 있습니다.
Nuget 패키지 관리자로 설치
PM> Install-Package TotalVoice -Version 1.0.1
또는 .NET CLI
dotnet add package TotalVoice --version 1.0.1
다음은이 라이브러리를 사용하는 방법에 대한 몇 가지 예입니다.
두 숫자 사이에서 전화 통화 : a와 b
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
Chamada chamada = new Chamada ( client ) ;
var json = new {
numero_origem = "48988888888" ,
numero_destino = "48999999999"
} ;
string response = chamada . Ligar ( json ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
} ID에 의한 전화 상담
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
Chamada chamada = new Chamada ( client ) ;
string response = chamada . Buscar ( 123 ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
} SMS를 보내십시오
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
Sms sms = new Sms ( client ) ;
var json = new {
numero_destino = "48999999999" ,
mensagem = "Mensagem de teste"
} ;
string response = sms . Enviar ( json ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
} 신분증으로 SMS 데이터 검색
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
Sms sms = new Sms ( client ) ;
string response = sms . Buscar ( 123 ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
} TTS를 보내십시오
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
Tts tts = new Tts ( client ) ;
var json = new {
numero_destino = "48999999999" ,
mensagem = "Mensagem de TTS"
} ;
string response = tts . Enviar ( json ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
} 숫자 유효성 검사
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
ValidaNumero validacao = new ValidaNumero ( client ) ;
var json = new {
numero_destino = "48999999999" ,
gravar_audio = true ,
bina = "48808880804" ,
max_tentativas = 1
} ;
string response = validacao . Enviar ( json ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
} 화합물을 보내십시오
namespace Teste
{
class Program
{
static void Main ( string [ ] args )
{
TotalVoiceClient client = new TotalVoiceClient ( "access-token" ) ;
Composto composto = new Composto ( client ) ;
var json = new {
numero_destino = "48988888888" ,
dados = new [ ] {
new {
acao = "tts" ,
acao_dados = new {
mensagem = "O número digitado não consta em nosso cadastro. Por gentileza, tente novamente" ,
tipo_voz = "br-Ricardo"
}
} ,
new {
acao = "audio" ,
acao_dados = new {
url_audio = "https://minhaurl.com.br/audio.mp3"
}
}
} ,
gravar_audio = false ,
bina = "48988888888" ,
tags = "clienteX" ,
detecta_caixa = false
} ;
string response = composto . Enviar ( json ) ;
System . Diagnostics . Debug . WriteLine ( response ) ;
}
}
}특허
이 라이브러리는 MIT의 이용 약관을 따릅니다