read

Messente API official python library

Among the official and community contributed development tools Messente now provides official messente-python library compatible with both Python2 and Python3.

The library is distributed via PyPI and can be installed simply with:
pip install messente-python

messente-python is open-source and resides on GitHub.

Currently supported Messente services are:
  • sms - sending sms, canceling a scheduled sms
  • delivery - obtaining delivery report
  • pricing - obtaining full price list and prices per country
  • credit - obtaining the balance of your account
  • verification - sending and verifying pin codes

To see it in action, let's take a simple example of sending sms:
import messente

api = messente.Messente(
    username="api_user",
    password="api_password"
)

response = api.sms.send({
    "to": "+372123456789",
    "from": "Server 2",
    "text": "Nginx restared at 10:32"
})

if response.is_ok():
    print("SMS Sent, id", response.get_sms_id())
else:
    print("Could not send SMS", response.get_full_error_msg())
Every API call returns a response object that provides utility methods for checking the status, error codes, obtaining the result of a performed action and translating the errors into meaningful messages.

For full documentation please visit GitHub page.
It's also worth mentioning that messente-python library comes with a list of example programs demonstrating the use of all the supported API calls.

Omni-channel messaging is here

Check out our latest webinar going over the details (plus a demo) of the intelligent A2P messaging API.
Learn more