Official Python client for the IPPanel SMS API.
You can install the package via pip:
pip install ippanel-python-sdkfrom ippanel import Client
# Initialize the client
client = Client("YOUR_API_KEY")
# Send a simple message via webservice
response = client.send_webservice(
message="Hello, this is a test message",
sender="YOUR_SENDER_NUMBER",
recipients=["RECIPIENT_NUMBER_1", "RECIPIENT_NUMBER_2"]
)
print(response)
# Send a pattern message
response = client.send_pattern(
pattern_code="YOUR_PATTERN_CODE",
sender="YOUR_SENDER_NUMBER",
recipient="RECIPIENT_NUMBER",
params={
"name": "John Doe",
"otp": "12345"
}
)
print(response)
# Send a voice OTP
response = client.send_votp(
code=12345,
recipient="RECIPIENT_NUMBER"
)
print(response)client = Client(api_key, base_url=None)api_key: Your IPPanel API keybase_url(optional): Custom base URL for the API (defaults to "https://edge.ippanel.com/v1/api")
client.send_webservice(message, sender, recipients)message: Text message to sendsender: Sender phone numberrecipients: List of recipient phone numbers
client.send_pattern(pattern_code, sender, recipient, params)pattern_code: The pattern codesender: Sender phone numberrecipient: Recipient phone numberparams: Dictionary of parameters for the pattern
client.send_votp(code, recipient)code: OTP code (integer or string)recipient: Recipient phone number
MIT