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
- Host: GitHub
- URL: https://github.com/caioagiani/backend-sms
- Owner: caioagiani
- Created: 2021-02-24T01:17:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-09T13:25:36.000Z (6 months ago)
- Last Synced: 2025-03-23T11:42:06.629Z (2 months ago)
- Topics: api, api-rest, apigateway, es6, gateway, javascript, mobizon, nodejs, shortcode, sms
- Language: JavaScript
- Homepage: https://mobizon.com.br
- Size: 72.3 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
Backend-SMS
![]()
![]()
![]()
![]()
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])