totalvoice node
Versão 1.12.0
TotalVoice API의 Nodejs 고객
기능
요구 사항
설치
npm install --save totalvoice-node또는
yarn add totalvoice-node사용
이 라이브러리를 사용하려면 먼저 Total Voice 웹 사이트에 등록해야합니다. 등록을 마친 후 API에 액세스 할 수있는 액세서로 골을 사용할 수 있습니다.
AccessStoken을 사용하면 API 문서에 따라 상담/등록을 할 수 있습니다.
호출 할 수있는 API 방법 :
이 라이브러리 사용 방법에 대한 다음 예제.
두 숫자 사이에서 전화를 걸립니다 : A와 B
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . chamada . ligar ( "4832830151" , "4811111111" )
. then ( function ( data ) {
console . log ( data )
} )
. catch ( function ( error ) {
console . error ( 'Erro: ' , error )
} ) ; ID에 의한 전화 상담
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . chamada . buscar ( 123 ) // ID da chamada
. then ( function ( data ) {
console . log ( data )
} )
. catch ( function ( error ) {
console . error ( 'Erro: ' , error )
} ) ; 활성 호출을 마감합니다
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . chamada . encerrar ( 123 ) // ID da chamada
. then ( function ( data ) {
console . log ( data )
} )
. catch ( function ( error ) {
console . error ( 'Erro: ' , error )
} ) ; SMS 배송
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
var resposta_usuario = false ;
var multi_sms = false ;
var data_criacao = '' ;
client . sms . enviar ( "4811111111" , "Mensagem SMS" , resposta_usuario , multi_sms , data_criacao )
. then ( function ( data ) {
console . log ( data )
} )
. catch ( function ( error ) {
console . error ( 'Erro: ' , error )
} ) ; TTS 배송
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
var opcoes = { velocidade : 2 , tipo_voz : "br-Vitoria" , bina : "bina_cadastrada" } ;
client . tts . enviar ( "4811111111" , "Mensagem TTS" , opcoes ) ;
. then ( function ( data ) {
console . log ( data ) ;
} )
. catch ( function ( error ) {
console . log ( 'Erro: ' , error )
} ) ; 오디오 제출
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . audio . enviar ( "4811111111" , "https://foo.bar/audio.mp3" )
. then ( function ( data ) {
console . log ( data ) ;
} )
. catch ( function ( error ) {
console . log ( 'Erro: ' , error )
} ) ; 중앙 전화 설정
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . central . buscaRamal ( 123546 ) // ID do Ramal
. then ( function ( data ) {
console . log ( data ) ;
} )
. catch ( function ( error ) {
console . log ( 'Erro: ' , error )
} ) ; 계정 데이터 관리
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . conta . buscar ( 123546 ) // ID da Conta
. then ( function ( data ) {
console . log ( data ) ;
} )
. catch ( function ( error ) {
console . log ( 'Erro: ' , error )
} ) ; 균형 균형 내 계정
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" ) ;
client . perfil . consultaSaldo ( )
. then ( function ( data ) {
console . log ( data ) ;
} )
. catch ( function ( error ) {
console . log ( 'Erro: ' , error )
} ) ; 총 음성으로 구성된 자신의 주소를 사용해야하는 경우
const totalvoice = require ( 'totalvoice-node' ) ;
const client = new totalvoice ( "access-token" , "https://seu-dominio.com.br" ) ;
...프록시와 함께 사용해야하는 경우
const totalvoice = require ( 'totalvoice-node' ) ;
let options = {
proxy : {
host : 'proxy.com' ,
port : 8888 ,
auth : {
username : 'XXXX' ,
password : 'XXXX'
}
}
} ;
const client = new totalvoice ( "access-token" , "https://seu-dominio.com.br" , options ) ;
...사용 가능한 방법에 대한 자세한 내용은 API 문서를 참조하십시오.
기여하다!
기여하고 싶습니까? 여기를 클릭하십시오
특허
이 라이브러리는 MIT의 이용 약관을 따릅니다