-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathexample.php
More file actions
26 lines (19 loc) · 783 Bytes
/
example.php
File metadata and controls
26 lines (19 loc) · 783 Bytes
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
<?php
require_once 'OX3_Api_Client.php';
$uri = 'http://localhost';
$email = 'root@openx.org';
$password = '';
$key = '';
$secret = '';
$realm = '';
$client = new OX3_API_Client($uri, $email, $password, $key, $secret, $realm);
// Add a user
//$result = $client->post('/a/user/', array('first_name' => 'Chris', 'last_name' => 'Nutting', 'account_id' => 7, 'email' => uniqid('chris.nutting+') . '@openx.org', 'status' => 'Active'));
// Get a user
$result = $client->get('/a/user/1');
if ($result->getStatus() == 200) {
echo "Response: " . print_r(json_decode($result->getBody(), true), true) . "\n";
} else {
echo "Non-200 response:\ncode: " . $result->getStatus() . "\nmessage: " . $result->getMessage() . "\nbody: " . $result->getBody() . "\n";
}
?>