Skip to main content

SMS framework: GatewayApi provider

Project description

Build Status Pythons

SMSframework GatewayAPI Provider

GatewayAPI Provider for smsframework.

Installation

Install from pypi:

$ pip install smsframework_gatewayapi

To receive SMS messages, you need to ensure that Flask microframework is also installed, as well as the JWT library:

$ pip install smsframework_gatewayapi[receiver]

Initialization

from smsframework import Gateway
from smsframework_gatewayapi import GatewayAPIProvider

gateway = Gateway()
gateway.add_provider('gapi', GatewayAPIProvider,
    key='AAABBBBCCCCDDDD', secret='XAD*HHH(aaaaa'
)

Config

Source: /smsframework_gatewayapi/provider.py

  • key: API key
  • secret: API secret
  • jwt_secret: Secret token for the JWT header (only for REST webhook that receives messages)

Example

from smsframework import Gateway, OutgoingMessage

# Send a regular message
gateway.send(OutgoingMessage('+19991112233', 'Test'))

# Send a premium message
gateway.send(OutgoingMessage('+19991112233', 'Test').options(escalate=True))

Supported Options

  • validity_period: Message expiration time in minutes
  • senderId: Alpha-numeric SenderId
  • escalate: Premium message

Provider-Specific Parameters

See https://gatewayapi.com/docs/rest.html#post--rest-mtsms

Receivers

Source: /smsframework_gatewayapi/receiver.py

GatewayApi uses a single webhook URL to receive both messages and status reports.

Webhook URL: <provider-name>/callback

In order to configure it, go to the API/Webhooks section in the control panel, and add a new "REST" webhook. The URL will be something like this: http://.../<prefix>/<provider-name>/callback

In the Authentication section, you can specify a JWT secret token. Pass it to the GatewayAPIProvider in order to have secure message reception.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for smsframework-gatewayapi, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size smsframework_gatewayapi-0.0.1-py2.py3-none-any.whl (7.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size smsframework_gatewayapi-0.0.1.tar.gz (6.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page