logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
data = {
    'first_name': 'Jerry',
    'last_name': 'Seinfeld',
    'address': '129 West 81st Street',
    'city': 'New York',
    'state': 'NY',
    'zip_code': '10024',
}

client = NextCallerClient(username, password, sandbox=sandbox)

# get by address
try:
    response_content = client.get_by_name_address(data)
    logger.info(response_content)
except HttpException as err:
    logger.error(
        'Response message: {}'.format(err.message),
    )
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException

logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
profile_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = NextCallerClient(username, password, sandbox=sandbox)

# get by profile id
try:
    response_content = client.get_by_profile_id(profile_id)
    logger.info(response_content)
except HttpException as err:
    logger.error('Response message: {}'.format(err.message), )
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException


logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
email = '*****@*****.**'

client = NextCallerClient(username, password, sandbox=sandbox)

# get by email
try:
    response_content = client.get_by_email(email)
    logger.info(response_content)
except HttpException as err:
    logger.error(
        'Response message: {}'.format(err.message),
    )
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException

logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
profile_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = NextCallerClient(username, password, sandbox=sandbox)

# update by profile id
try:
    data = {'email': '*****@*****.**'}
    client.update_by_profile_id(profile_id, data)
except HttpException as err:
    logger.error('Response message: {}'.format(err.message), )
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException


logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
phone_number = '1211211212'

client = NextCallerClient(username, password, sandbox=sandbox)

# get by phone
try:
    response_content = client.get_by_phone(phone_number)
    logger.info(response_content)
except HttpException as err:
    logger.error(
        'Response message: {}'.format(err.message),
    )
logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
debug = True
phone_number = '1211211212'

client = NextCallerClient(username, password, sandbox=sandbox, debug=debug)

# get fraud level
try:
    response_content = client.get_fraud_level(phone_number)
    logger.info(response_content)
except ValueError as err:
    logger.error('Validation Error: {}'.format(err))
except HTTPError as err:
    response = err.response
    response_code = response.status_code
    # try to parse error json message
    try:
        response_message = response.json()
    except (ValueError, TypeError):
        response_message = response.text
Beispiel #7
0
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException

logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
phone_number = '1211211212'

client = NextCallerClient(username, password, sandbox=sandbox)

# get by phone
try:
    response_content = client.get_by_phone(phone_number)
    logger.info(response_content)
except HttpException as err:
    logger.error('Response message: {}'.format(err.message), )
Beispiel #8
0
from pynextcaller.exceptions import HttpException

logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
data = {
    'first_name': 'Jerry',
    'last_name': 'Seinfeld',
    'address': '129 West 81st Street',
    'city': 'New York',
    'state': 'NY',
    'zip_code': '10024',
}

client = NextCallerClient(username, password, sandbox=sandbox)

# get by address
try:
    response_content = client.get_by_name_address(data)
    logger.info(response_content)
except HttpException as err:
    logger.error('Response message: {}'.format(err.message), )
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException


logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
profile_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = NextCallerClient(username, password, sandbox=sandbox)

# get by profile id
try:
    response_content = client.get_by_profile_id(profile_id)
    logger.info(response_content)
except HttpException as err:
    logger.error(
        'Response message: {}'.format(err.message),
    )
Beispiel #10
0
import logging
from pynextcaller.client import NextCallerClient
from pynextcaller.exceptions import HttpException

logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
email = '*****@*****.**'

client = NextCallerClient(username, password, sandbox=sandbox)

# get by email
try:
    response_content = client.get_by_email(email)
    logger.info(response_content)
except HttpException as err:
    logger.error('Response message: {}'.format(err.message), )
logger = logging.getLogger('nextcaller')
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

username = '******'
password = '******'
sandbox = True
debug = True
profile_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = NextCallerClient(username, password, sandbox=sandbox, debug=debug)

# update by profile id
try:
    data = {'email': '*****@*****.**'}
    client.update_by_profile_id(profile_id, data)
except ValueError as err:
    logger.error('Validation Error: {}'.format(err))
except HTTPError as err:
    response = err.response
    response_code = response.status_code
    # try to parse error json message
    try:
        response_message = response.json()
    except (ValueError, TypeError):
        response_message = response.text