Official Emailage API client written in Python
Project description
The Emailage™ API is organized around REST (Representational State Transfer). The API was built to help companies integrate with our highly efficient fraud risk and scoring system. By calling our API endpoints and simply passing us an email and/or IP Address, companies will be provided with real-time risk scoring assessments based around machine learning and proprietary algorithms that evolve with new fraud trends.
Getting Started
Requirements
Python 2.7+ or 3.3+
Installation
Emailage can be installed with pip:
$ pip install emailage-official
or directly from the source code:
$ git clone https://github.com/emailage/Emailage_Python.git $ cd Emailage_Python $ python setup.py install
Usage
Instantiate a client
from emailage.client import EmailageClient
# For a production server
emailage = EmailageClient('My account SID', 'My auth token')
# ... or for a sandbox
emailage = EmailageClient('My account SID', 'My auth token', sandbox=True)
Query risk score information for the provided email address, IP address, or a combination
# For an email address
emailage.query('test@example.com')
# For an IP address
emailage.query('127.0.0.1')
# For a combination. Please note the order
emailage.query(('test@example.com', '127.0.0.1'))
# Pass a User Defined Record ID (URID).
# Can be used when you want to add an identifier for a query.
# The identifier will be displayed in the result.
emailage.query('test@example.com', urid='My record ID for test@example.com')
Explicit methods produce the same request while validating format of the arguments passed
# For an email address
emailage.query_email('test@example.com')
# For an IP address
emailage.query_ip_address('127.0.0.1')
# For a combination. Please note the order
emailage.query_email_and_ip_address('test@example.com', '127.0.0.1')
# Pass a User Defined Record ID
emailage.query_email_and_ip_address('test@example.com', '127.0.0.1', urid='My record ID for test@example.com and 127.0.0.1')
# Mark an email address as fraud because of Synthetic ID.
emailage.flag('fraud', 'test@example.com', 8)
emailage.flag_as_fraud('test@example.com', 8)
# Mark an email address as good.
emailage.flag('good', 'test@example.com')
emailage.flag_as_good('test@example.com')
# Unflag an email address that was previously marked as good or fraud.
emailage.flag('neutral', 'test@example.com')
emaila
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for emailage_official-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e345e520525dffef1d075525415e3ae8298bbb7eb5b635b551725bb7a41c888 |
|
MD5 | 907505c443a8f36ba650dbe2fb6a2bb3 |
|
BLAKE2b-256 | 99e0d16c2d708263964de87989f17354bcac18eb56c8b6e14921cd3ad7c5c8e7 |