brite-verify/brite-api

Client binding for BriteVerify API

Installs: 1 264

Dependents: 0

Stars: 4

Watchers: 3

Forks: 2

Language: PHP

0.0.2 2013-04-08 13:49 UTC

README

The official BriteVerify API Client for PHP

require 'BriteAPIContact.php';
require 'BriteAPIClient.php';

# Option #1
$client = new BriteAPIContact($api_key);

# Option #2
$client = new BriteAPIContact($config->api_key, array('name' => '123456', 'ip' => '1.1.1.1'));

# Set/update fields
$client->name = '1234567';
$client->ip = '128.128.128.328';
$client->email = 'fake@wrong.com';
$client->phone = '+123456789';
$client->address = array('zip' => '28210', 'street' => '120 N Cedar', 'unit' => 'Apt 3201');

# Verify input data
$client->verify();

# Output
$client->is_valid() # false
$client->status() # "invalid"
$client->errors() # array('name' => 'Contains non alphabetic', 'phone' => 'Invalid format' ...)
$client->error_codes() # array('invalid_format','address_invalid',...)

$client->response['email']
# array(
#   'address' => 'fake@wrong.com',
#   'account' => 'fake',
#   'domain' => 'wrong.com',
#   'status' => 'invalid',
#   'error_code' => 'email_account_invalid',
#   'error' => 'Email account invalid',
#   'disposable' => '',
#   'role_address' => '',
#   'duration' => 0.049145096
# )

Documentation