Compare commits
4 Commits
f2ccc092f8
...
e51fd5f591
Author | SHA1 | Date |
---|---|---|
![]() |
e51fd5f591 | |
![]() |
9f800b4f99 | |
![]() |
f794d5de2c | |
![]() |
e71a8101e9 |
33
README.md
33
README.md
|
@ -30,10 +30,39 @@ Python flask app that uses voip.ms to manage a number of DID numbers for SMS. Ca
|
|||
|
||||
The config used in this project uses the JSON format and expects a `username` and `password`
|
||||
|
||||
Ex:
|
||||
Ex:
|
||||
```
|
||||
{
|
||||
"username":"voipms-email",
|
||||
"password":"voipms-api-password"
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
## Endpoints
|
||||
|
||||
### /numbers
|
||||
|
||||
*Returns a list of numbers in use*
|
||||
|
||||
Supports: GET
|
||||
|
||||
Returns a list of javascript objects with keys: did (int as string), sms_available (boolean as int), mms_available (boolean as int)
|
||||
|
||||
### /sms
|
||||
|
||||
*Returns sms/mms messages for a given number*
|
||||
|
||||
Supports: GET,POST
|
||||
Expects: string `did`
|
||||
|
||||
Returns a list of javascript objects with keys: message (string), did (int as string), contact (string as int), date (date as string), media (list)
|
||||
|
||||
### /enablesms
|
||||
|
||||
*[DISABLED] Enables sms feature for a given number*
|
||||
|
||||
Supports: GET,POST
|
||||
Expects: string `did`
|
||||
|
||||
Returns a boolean as int
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
from flask import Flask, request, abort
|
||||
from voipms.api import Client
|
||||
import did, sms
|
||||
|
@ -10,8 +11,8 @@ client = Client(conf["username"],conf["password"])
|
|||
|
||||
|
||||
@app.route("/", methods=['GET'])
|
||||
def hello_world():
|
||||
return "<p>Hello, World!</p>"
|
||||
def default():
|
||||
return '<a href="http://git.community.i2p/anons-voip/voipsms">Check out the project</a>'
|
||||
|
||||
@app.route("/numbers", methods=['GET'])
|
||||
def get_numbers():
|
||||
|
@ -28,3 +29,8 @@ def set_sms():
|
|||
abort(403)
|
||||
did = request.args.get('did')
|
||||
return sms.get_sms(client, did)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from waitress import serve
|
||||
serve(app, host="0.0.0.0", port=8080)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
voipms-python
|
||||
flask
|
||||
waitress
|
||||
requests
|
Loading…
Reference in New Issue