An open API service indexing awesome lists of open source software.

https://github.com/caioagiani/backend-sms

API para disparos de SMS e Encurtador de URL com Gateway Mobizon
https://github.com/caioagiani/backend-sms

api api-rest apigateway es6 gateway javascript mobizon nodejs shortcode sms

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        


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](https://github.com/mobizon/mobizon-php/tree/master/docs/examples)

## API Key

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

- [mobizon.com.br](https://mobizon.com.br)

## Iniciar aplicação

```bash
# clone
$ git clone [email protected]: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

- [x] Enviar SMS:

```javascript
post('/sms/create');
{
"recipient": "5511941439844",
"text": "Hello!"
}
```

- [x] Encurtar link / listar links:

```javascript
post('/shorts/create')
{
"data": {
"fullLink": "https://google.com.br"
}
}
```

```javascript
post('/shorts/list')
{
"criteria": {
"status": "1",
"moderatorStatus": "1"
},
"pagination": {
"currentPage": "1",
"pageSize": "10"
},
"sort": {
"clickCnt": "DESC"
}
}
```

Importe as rotas no seu [Insomnia](https://insomnia.rest/run/?label=backend-sms&uri=https://raw.githubusercontent.com/caioagiani/backend-sms/master/insomnia.json).

## Testes

```javascript
$ 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

- [@juan-patrick](https://github.com/juan-patrick) - Frontend
- [@caioagiani](https://github.com/caioagiani) - Backend

## Contato

- [LinkedIn](https://www.linkedin.com/in/caioagiani)
- [[email protected]](mailto:[email protected])