https://github.com/dilshat/sms-sender
Simple service to send sms messages via http requests
https://github.com/dilshat/sms-sender
delivery http rest smpp sms
Last synced: 10 days ago
JSON representation
Simple service to send sms messages via http requests
- Host: GitHub
- URL: https://github.com/dilshat/sms-sender
- Owner: dilshat
- License: apache-2.0
- Created: 2019-12-04T10:16:57.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T05:46:10.000Z (over 5 years ago)
- Last Synced: 2024-06-20T17:31:06.269Z (over 1 year ago)
- Topics: delivery, http, rest, smpp, sms
- Language: Go
- Size: 9.54 MB
- Stars: 6
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/Dilshat/sms-sender)
[](https://goreportcard.com/report/github.com/Dilshat/sms-sender)
[](https://codecov.io/gh/Dilshat/sms-sender)
[](https://codeclimate.com/github/Dilshat/sms-sender/maintainability)
#### SMS service
Simple sms service that provides HTTP API to send text messages.
It connects directly to SMS Center or SMS proxy of telecom operator using SMPP 3.4 procotol.
HTTP API description is available at `http://${base-path}/swagger/index.html` (the service must be running)
#### Examples of using HTTP API
- Sending message (there might be more than one recipient phone):
```
curl localhost:8080/sms -H "Content-Type: application/json" -d '{"phones":["996XXXZZZZZZ"],"text":"hello", "sender":"awesome"}'
```
will return response containing id of message, which can be used later to check status of message delivery:
```
{"id":56}
```
- Check status of message delivery
```
curl localhost:8080/sms/56
curl localhost:8080/sms/56?phone=996XXXZZZZZZ
```
response:
```
{
"id": 56,
"sender": "awesome",
"text": "hello",
"statuses": [
{
"phone": "996XXXZZZZZZ",
"status": "DELIVRD"
}
]
}
```
Message statues are stored N days in the service database (_number of days can be configured in the service settings_).
All settings are stored in the file **.env**; environment variables with the same names as in the .env file override the latter ones.
#### Delivery status reception
If _WEB_HOOK_ is set to some non-empty URL, the service will send notifications about delivery status receipt (a separate update per each phone) to the specified http endpoint in the following form:
```
{
"id": 56,
"sender": "awesome",
"text": "hello",
"statuses": [
{
"phone": "996XXXZZZZZZ",
"status": "DELIVRD"
}
]
}
```