-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.php
53 lines (38 loc) · 1.01 KB
/
example.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require 'vendor/autoload.php';
use Securepass\Securepass;
$app_id = YOUR_APP_ID;
$app_secret = YOUR_APP_SECRET;
// base options
$config = array(
'app_id' => $app_id,
'app_secret' => $app_secret
);
// configure a proxy
$config['request.options']['proxy'] = 'http://proxy.local';
// override base_url
$config['base_url'] = 'http://securepass.local';
$securepass = new Securepass($options);
$res = $securepass->ping();
/* User operations */
// Authentication
$auth = array('username' => '[email protected]',
'password' => 'foobar')
$res = $securepass->user('auth', $auth);
// Create user
$user = array(
'username' => 'foobar',
'name' => 'Foo',
'surname' => 'Bar',
'email' => '[email protected]',
'mobile' => '+395551234567890'
);
$res = $securepass->user('create', $user);
// Provision user
$provision = array(
'username' => "[email protected]",
'swtoken' => "android"
);
$res = $securepass->user('provision', $provision);
// List users
$res = $securepass->user('list');