totalvoice csharp
Versão 1.2.1
ไคลเอนต์ C# สำหรับ API ของ TotalVoice
ฟังก์ชั่น
ล่วงหน้า
ใช้
ในการใช้ไลบรารีนี้คุณต้องลงทะเบียนบนเว็บไซต์ทั้งหมด หลังจากการสร้างการลงทะเบียนจะพร้อมใช้งาน accessOstoken สำหรับการเข้าถึง API
ด้วย AccessSstoken ในมือมันจะเป็นไปได้ที่จะทำการปรึกษาหารือ/การลงทะเบียนตามเอกสาร API
การติดตั้งด้วย Nuget Package Manager
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 โดย ID
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