Giter VIP home page Giter VIP logo

mobizon-br's Introduction

Mobizon

Biblioteca para comunicação API HTTP Mobizon SMS

GitHub language count GitHub top language GitHub repo size NPM downloads GitHub license

Instalação

Baixe o node em nodejs.org e instale-o, caso ainda não tenha,

Pacote: npm i mobizon-node ou yarn add mobizon-node

Configuração:

const { mobizon } = require('mobizon-node');

mobizon.setConfig({
  apiServer: 'https://api.mobizon.com.br',
  apiKey: 'br01xxxxxx',
  format: 'json',
});

Exemplos de uso

Confira em docs todos os response status code.

(async () => {
  /** Saldo */
  const getBalance = await mobizon.getBalance();

  console.log(getBalance);

  /** Encurtar URL */
  const createShort = await mobizon.createShort({
    data: {
      fullLink: 'https://mobizon.com.br',
      status: 1,
      expirationDate: '',
      comment: 'Shortened link.',
    },
  });

  console.log(createShort);

  /** Enviar SMS */
  const sendSms = await mobizon.sendSms({
    recipient: '5511900000000',
    from: '',
    text: 'SMS sent by Mobizon.',
  });

  console.log(sendSms);
})();

Dê uma olhada em example.js para mais casos de uso.

Testes

yarn lint && jest --setupFiles dotenv/config --detectOpenHandles --forceExit
$ eslint . --ext .js
 PASS  __tests__/shortlink.test.js
 PASS  __tests__/sms.test.js
 PASS  __tests__/balance.test.js

Test Suites: 3 passed, 3 total
Tests:       14 passed, 14 total
Snapshots:   0 total
Time:        7.013 s
Ran all test suites.
Done in 8.41s.

Licença

Copyright © 2021 caioagiani.
Este projeto é licenciado MIT.

mobizon-br's People

Contributors

caioagiani avatar githubfollow avatar

Stargazers

 avatar  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.