PhonebookApi - Python client for Messente Phonebook API
Python 2.7 and 3.4+
The latest released version is available via PyPI
pip install phonebook-api
For the latest (unreleased) version you may want to install from Github
git+https://github.com/messente/messente-phonebook-python.git
Then import the package:
import phonebook_api
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import phonebook_api
Please follow the installation procedure and then run the following:
from phonebook_api import (
BlacklistApi,
ApiClient,
Configuration
)
from phonebook_api.rest import ApiException
# Configure HTTP basic authorization: basicAuth
configuration = Configuration()
configuration.username = 'YOUR_MESSENTE_API_USERNAME'
configuration.password = 'YOUR_MESSENTE_API_PASSWORD'
# create an instance of the API class
api_instance = BlacklistApi(ApiClient(configuration))
try:
response = api_instance.fetch_blacklist()
print(response)
except ApiException as e:
print("Exception when calling fetch_blacklist: %s\n" % e)
# try:
# api_instance.add_to_blacklist({'phoneNumber': '+37255555555'})
# except ApiException as e:
# print("Exception when calling add_to_blacklist: %s\n" % e)
# try:
# api_instance.is_blacklisted('+37255555555')
# except ApiException as e:
# print("Exception when calling is_blacklisted: %s\n" % e)
# try:
# api_instance.remove_from_blacklist('+37255555555')
# except ApiException as e:
# print("Exception when calling remove_from_blacklist: %s\n" % e)
All URIs are relative to https://api.messente.com/v1
Class | Method | HTTP request |
---|---|---|
BlacklistApi | add_to_blacklist | POST /phonebook/blacklist |
BlacklistApi | fetch_blacklist | GET /phonebook/blacklist |
BlacklistApi | is_blacklisted | GET /phonebook/blacklist/{phone_number} |
BlacklistApi | remove_from_blacklist | DELETE /phonebook/blacklist/{phone_number} |
- ErrorItem
- ErrorResponse
- FetchBlacklistSuccess
- NumberToBlacklist
- ResponseErrorCode
- ResponseErrorTitle
- Type: HTTP basic authentication