Skip to content

Cross-platform SMS Gateway JSON REST API Python server

Notifications You must be signed in to change notification settings

cheese528/smsgateway

Repository files navigation

Attribution

Setting Up

  1. (optional for development environment) Create virtualenv of this directory: virtualenv .
  2. (optional for development environment) Switch into the virtualenv by cd and scripts\activate or scripts\activate.bat in that directory
  3. Depending on whether to set up for headless server or with win32 GUI, install the modules using the appropriate requirements file: pip install -r requirements.txt or pip install -r requirements-win32.txt

Building

Headless server use can skip this step. Building to win32 single exe requires this command: pyinstaller smsgateway.spec

Running

  • For headless server, run the sgserver.py file using python sgserver.py [options]. Typing python sgserver.py -h will show the help.
  • For win32 GUI, look in the dist folder for the .exe that was generated

Using the API

Sending Messages

Send your text message to the running server at http://servername/v1/sendsms using a POST with a JSON encoded message containing:

{
    "key": "Your secret key configured for the server",
    "number": "The phone number",
    "message": "The message"
}

The call returns with the status in JSON containing the 1) reference number, 2) status, 3) the original message.

Checking Messages

Check on the status of the message by sending a GET request to http://servername/v1/smsstatus/referencenumber

  • A JSON is returned containing the 1) reference number, 2) status, 3) the original message

About

Cross-platform SMS Gateway JSON REST API Python server

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages