diff --git a/remoting_client/examples/rest_example.php b/remoting_client/examples/rest_example.php new file mode 100644 index 0000000000000000000000000000000000000000..24a009c14b326357571f79ee7a2280361562ff29 --- /dev/null +++ b/remoting_client/examples/rest_example.php @@ -0,0 +1,57 @@ + $remote_user, 'password' => $remote_pass, 'client_login' => false)); +if($result) { + $data = json_decode($result, true); + if(!$data) die("ERROR!\n"); + + $session_id = $data['response']; + + $result = restCall('client_get', array('session_id' => $session_id, 'client_id' => array('username' => 'abcde'))); + if($result) var_dump(json_decode($result, true)); + else print "Could not get client_get result\n"; + + // or by id + $result = restCall('client_get', array('session_id' => $session_id, 'client_id' => 2)); + if($result) var_dump(json_decode($result, true)); + else print "Could not get client_get result\n"; + + // or all + $result = restCall('client_get', array('session_id' => $session_id, 'client_id' => array())); + if($result) var_dump(json_decode($result, true)); + else print "Could not get client_get result\n"; + + $result = restCall('logout', array('session_id' => $session_id)); + if($result) var_dump(json_decode($result, true)); + else print "Could not get logout result\n"; +}