Giter VIP home page Giter VIP logo

velip's Introduction

velip

Módulo de integração com a API de Voz da Velip.

Instalação

npm i velip

Pré requisito

Cadastrar no painel da plataforma o IP da máquina que irá realizar as operações, pois essa é a forma da Velip identificar cada cliente.

Como usar

Para criar um torpedo de voz baseado em texto (TTS) na plataforma da Velip:

const Velip = require('velip');

const credentials = { user: 'nomedeusuario', password: 'senha' };

const audio = new Velip.Audio(credentials);

const tts = audio.tts();
tts
  .text('Olá Mundo!')
  .save()
  .then(res => {
    console.log(res);
  })
  .catch(err => {
    console.log(err);
  });

Para disparar um torpedo de voz logo após criá-lo:

const Velip = require('velip');

const credentials = { user: 'nomedeusuario', password: 'senha' };

const audio = new Velip.Audio(credentials);
const calling = new Velip.Calling();
calling.to(11966669999);

const tts = audio.tts();
tts
  .text('Olá Mundo!')
  .save()
  .then(savedResponse => {
    calling.call(savedResponse)
      .then(calledResponse => console.log(calledResponse))
      .catch(err => console.log(err));
  })
  .catch(err => console.log(err));

Para criar e disparar um torpedo de voz de uma só vez:

const Velip = require('velip');

const credentials = { user: 'climatempoconsultoria', password: 'climatempo' };

const audio = new Velip.Audio(credentials);
const tts = audio.tts();
tts.text('Olá Mundo!');

const calling = new Velip.Calling();
calling
  .to(11966669999)
  .audio(tts)
  .call()
  .then(callingResponse => console.log(callingResponse))
  .catch(err => console.log(err));

Para disparar um torpedo de voz que já está salvo na plataforma da Velip:

const Velip = require('velip');

const calling = new Velip.Calling();
calling
  .to(11966669999)
  .audio('tf816746363')
  .call()
  .then(callingResponse => console.log(callingResponse))
  .catch(err => console.log(err));

velip's People

Contributors

michaelfdias avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.