Skip to content

wigalgh/Python_SDK_For_FROG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frog Python SDK

A simple Python SDK for the Frog Messaging API (SMS & Voice).

Installation

pip install -r requirements.txt

Usage

Initialize

from frog_sdk import FrogSDK

sdk = FrogSDK(api_key='YOUR_API_KEY', username='YOUR_USERNAME')

SMS Messaging

Send General SMS

Sends a standard text message to one or more destinations.

response = sdk.send_sms(
    senderid='WIGAL',
    destinations=[
        {'destination': '233XXXXXXXXX', 'msgid': 'ID-001'}
    ],
    message='Hello from Frog Python SDK!',
    smstype='text' # Optional: 'text', 'flash', or 'unicode'
)

Send Personalized SMS

Sends different messages to different recipients in a single request.

response = sdk.send_personalized_sms(
    senderid='WIGAL',
    destinations=[
        {'destination': '233XXXXXXXX1', 'message': 'Hello John!', 'msgid': 'P1'},
        {'destination': '233XXXXXXXX2', 'message': 'Hello Jane!', 'msgid': 'P2'}
    ]
)

SMS OTP (One-Time Password)

Generate SMS OTP

response = sdk.generate_sms_otp(
    senderid='WIGAL',
    number='233XXXXXXXXX',
    otplength=6,
    otptype='NUMERIC', # 'NUMERIC' or 'ALPHANUMERIC'
    expiry=5 # Expiry in minutes
)

Verify SMS OTP

response = sdk.verify_sms_otp(
    number='233XXXXXXXXX',
    otpcode='123456'
)

Voice Messaging

Send Voice Message

Plays a pre-recorded audio file to recipients.

response = sdk.send_voice(
    callerid='WIGAL',
    soundurl='https://yourserver.com/alerts/welcome.mp3',
    destinations=[
        {'destination': '233XXXXXXXXX', 'msgid': 'V1'}
    ]
)

Send Interactive Voice (DTMF)

Plays a prompt and collects keypad input from the recipient.

response = sdk.send_interactive_voice(
    callerid='WIGAL',
    promptfile='https://yourserver.com/prompts/menu.mp3',
    dtmfcount=1, # Number of digits to collect
    destinations=[
        {'destination': '233XXXXXXXXX', 'msgid': 'IVR1'}
    ]
)

Voice OTP

Generate Voice OTP

response = sdk.generate_voice_otp(
    callerid='WIGAL',
    number='233XXXXXXXXX',
    otplength=6,
    otptype='NUMERIC',
    expiry=5
)

Verify Voice OTP

response = sdk.verify_voice_otp(
    number='233XXXXXXXXX',
    otpcode='654321'
)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages