Clickatell Provider for smsframework.
You need a "Developers' Central" Clickatell account with an HTTP API set up. From the API, you need: api_id, username, password.
Install from pypi:
$ pip install smsframework_clickatell
To receive SMS messages, you need to ensure that Flask microframework is also installed:
$ pip install smsframework_clickatell[receiver]
from smsframework import Gateway
from smsframework_clickatell import ClickatellProvider
gateway = Gateway()
gateway.add_provider('clickatell', ClickatellProvider,
api_id=1,
user='kolypto',
password='123',
https=False
)
Source: /smsframework_clickatell/provider.py
api_id: str
: API ID to useuser: str
: Account usernamepassword: str
: Account passwordhttps: bool
: Use HTTPS for outgoing messages? Default:False
Provider-specific sending params:
deliv_time: int
: Delay the delivery for X minutes
Example:
from smsframework import OutgoingMessage
gateway.send(OutgoingMessage('+123', 'hi').params(deliv_time=15))
None.
api_id: str
: API idcharset: str
: Message character set (when applicable, else - None)udh: str
: Header Data (when applicable, else - None)
status: int
: Message status codeapi_id: str
: API idcharge: float
: Charged funds
Returns the credist left on the account:
provider = gateway.get_provider('clickatell')
provider.get_balance() #-> 10.6
Source: /smsframework_clickatell/receiver.py
After a number is purchased, go to Receive Messages > Manage long numbers / short codes, and then click the ‘Edit’ link of the two-way number which you would like to configure. Set "Reply Path" to "HTTP Get" | "HTTP Post", in the field - put the message receiver URL.
- "Username & Password" is not supported
- "Secondary callback" is up to you
Message Receiver URL: <provider-name>/im
To start getting status reports from Clickatell, edit the HTTP API in the admin panel and click on "Enable your app to receive message delivery notifications". In the field, put the receiver URL.
- Status receiver only supports "HTTP Get" and "HTTP Post" methods.
- "basic HTTP Authentication" is not supported
Status Receiver URL: <provider-name>/status