https://github.com/ppai-plivo/sync-message-server
Convert Plivo's messaging (SMS, MMS) API from async to sync.
https://github.com/ppai-plivo/sync-message-server
async go golang mms plivo plivo-mms plivo-sms reverse-proxy sms sync
Last synced: 5 months ago
JSON representation
Convert Plivo's messaging (SMS, MMS) API from async to sync.
- Host: GitHub
- URL: https://github.com/ppai-plivo/sync-message-server
- Owner: ppai-plivo
- License: mit
- Created: 2021-08-19T18:24:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-26T16:14:55.000Z (almost 5 years ago)
- Last Synced: 2024-06-19T19:28:36.092Z (almost 2 years ago)
- Topics: async, go, golang, mms, plivo, plivo-mms, plivo-sms, reverse-proxy, sms, sync
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## sync-message-server
sync-message-server converts Plivo's messaging (SMS, MMS) API from async to sync.
### Usage
```sh
$ # Edit config.go
$ go build
$ ./sync-message-server
2021/08/19 23:13:35 started reverse proxy; addr=:8090
2021/08/19 23:13:35 started callback server; addr=:8091
2021/08/19 23:37:37 responding; body={"message_uuid":"54ada4a2-0118-11ec-8ca5-0242ac110006","message_state":"sent","message_time":"2021-08-19 18:07:35.315189","sent_time":"2021-08-19 18:07:37.280569","total_rate":"0.03800","total_amount":"0.03800","units":1,"error_code":""}
```
Example request and response:
```sh
$ curl -s -u MAXXXXXXXXXXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY -X POST http://localhost:8090/v1/Account/MAXXXXXXXXXXXXXXXXXX/Message/ -H 'content-type: application/json' -d '{
"src" : "+1 xxx-xxx-xxx",
"dst" :"+91 xxx-xxx-xxx",
"text" : "Hello World!"
}' | python -m json.tool
```
```json
{
"error_code": "",
"message_state": "sent",
"message_time": "2021-08-19 18:07:35.315189",
"message_uuid": "54ada4a2-0118-11ec-8ca5-0242ac110006",
"sent_time": "2021-08-19 18:07:37.280569",
"total_amount": "0.03800",
"total_rate": "0.03800",
"units": 1
}
```