-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlead_verify.php
More file actions
32 lines (27 loc) · 1.12 KB
/
Copy pathlead_verify.php
File metadata and controls
32 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once 'vendor/autoload.php';
$url = 'https://proapi.whitepages.com/3.3/lead_verify.json';
$headers = ['Accept' => 'application/json'];
$query = [
'name' => 'Drama Number',
'phone' => '6464806649',
'email_address' => 'medjalloh1@yahoo.com',
'address_city' => 'Ashland',
'address.postal_code' => '59004',
'address.state_code' => 'MT',
'address.country_code' => 'US',
'address.street_line_1' => '302 Gorham Ave',
'ip_address' => '108.194.128.165',
'api_key' => getenv('LEAD_VERIFY_API_KEY'),
];
$response = Unirest\Request::get($url, $headers, $query);
$available_checks = [
'phone_checks',
'address_checks',
'email_address_checks',
'ip_address_checks',
];
foreach ($available_checks as $check) {
// Unirest decodes json by default to stdClass.
echo json_encode($response->body->$check).PHP_EOL;
}