Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

messente/messente-phonebook-python

Repository files navigation

Messente Phonebook API

PhonebookApi - Python client for Messente Phonebook API

Requirements

Python 2.7 and 3.4+

Installation & Usage

pip install

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

Setuptools

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

Getting Started

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)

Documentation for API Endpoints

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}

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Author

messente@messente.com