Socket
Socket
Sign inDemoInstall

mobizon-br

Package Overview
Dependencies
479
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mobizon-br

Mobizon é um poderoso gateway de SMS e ferramentas de marketing online.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

MobizonBR

Biblioteca para comunicação API HTTP Mobizon SMS

GitHub language count GitHub top language GitHub repo size GitHub license

Instalação

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

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

Configuração:

const mobizon = require('mobizon-br');

mobizon.setConfig({
  apiServer: 'https://api.mobizon.com.br',
  apiKey: process.env.API_KEY,
  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 short = await mobizon.short({
    fullLink: 'https://mobizon.com.br',
    status: 1,
    expirationDate: '',
    comment: 'MobizonBR',
  });

  console.log(short);

  /** Enviar SMS */
  const sendSms = await mobizon.sendSms({
    recipient: process.env.NUMBER,
    from: '',
    text: 'MobizonBR',
  });

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

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

Testes

 jest --setupFiles dotenv/config --detectOpenHandles --forceExit
 PASS  tests/mobizon.test.js
  Mobizon feature tests
    ✓ should receive the account balance (323 ms)
    ✓ should create short link (447 ms)
    ✓ should get short link (349 ms)
    ✓ should update short link (325 ms)
    ✓ should delete short link (390 ms)
    ✓ should send a test sms (610 ms)
    ✓ should list the sms sent by id (312 ms)
    ✓ should list the all sms sent (762 ms)

Test Suites: 1 passed, 1 total
Tests:       8 passed, 8 total
Snapshots:   0 total
Time:        4.208 s
Ran all test suites.
Done in 4.65s.

Licença

Copyright © 2021 caioagiani.
Este projeto é licenciado MIT.

Keywords

FAQs

Last updated on 13 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc