Pyng: GatewayAPI pager

Description

GatewayAPI Pager is able to send SMS text message alerts and notifications using the GatewayAPI SMS Gateway.

The pager uses GatewayAPI REST API. Note that contact phone numbers have to be entered using the full mobile phone number format.

GatewayAPI Pager requires curl command to be present in $PATH.

Options

GatewayAPI Pager supports following options, which may be used upon creation of a new pager object:

token
Authentication token (required)
sender
Originator of the message (required)

In addition, GatewayAPI Pager supports following generic pager settings:

desc
Pager description
target
Default pager target, which is used as default recipient of pager messages in the pager's alert() and notify() methods

Example

pager = GatewayAPIPager(
    token='...',
    sender='pyng alert',
    target='47........', # https://gatewayapi.com/docs/glossary/#msisdn
)

# now you may use pager.alert() in the alert parameter in the checks,
# and pager.notify() in the notify paramter in the checks. alternatively,
# you may assign result of those methods to variables and use those in the
# checks

alerter = pager.alert()
notifier = pager.notify()

# alerter may be used in the alert parameter, and notifier in the notify parameter

# alert() and notify() methods will call send, with target
# given in alert() or notify(), or the default target given
# when creating the pager object

# calling send() may be used to test the pager
#pager.send('short summmary', 'not used for GatewayAPI')
    

Return to Pyng