Skip to content

API para disparos de SMS e Encurtador de URL com Gateway Mobizon

Notifications You must be signed in to change notification settings

caioagiani/backend-sms

Repository files navigation

mobizon sms

Backend-SMS

GitHub language count GitHub top language GitHub repo size GitHub license

Aplicação API para disparos de SMS e Encurtador de URL usando o Gateway - Mobizon

API Key

Necessário registrar a conta no site abaixo para obter sua key:

Iniciar aplicação

# clone
$ git clone git@github.com:caioagiani/backend-sms.git

# abrir pasta
$ cd backend-sms

# configurar vars ambiente
$ cp .env.example .env

# instalar dependências
$ yarn install

# iniciar aplicação
$ yarn dev

Endpoints

  • Enviar SMS:
post('/sms/create');
{
  "recipient": "5511941439844",
  "text": "Hello!"
}
  • Encurtar link / listar links:
post('/shorts/create')
{
  "data": {
    "fullLink": "https://google.com.br"
  }
}
post('/shorts/list')
{
  "criteria": {
    "status": "1",
    "moderatorStatus": "1"
  },
  "pagination": {
    "currentPage": "1",
    "pageSize": "10"
  },
  "sort": {
    "clickCnt": "DESC"
  }
}

Importe as rotas no seu Insomnia.

Testes

$ jest --setupFiles dotenv/config --detectOpenHandles --forceExit
 PASS  __tests__/short.test.js
  API Requests
     should send an sms (865 ms)
     should create a shortened link (477 ms)
     should list all shortened links (317 ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        2.871 s, estimated 3 s
Ran all test suites.
Done in 3.29s.

Colaboradores

Contato