$api = new ProtectimusApi(USERNAME, API_KEY, API_URL); echo "CREATING A USER<br/>"; $response = $api->addUser("login", "*****@*****.**", 12345678912, "pwd", null, null, true); echo print_r($response, true) . "<br/>"; $userId = $response->response->id; echo "ID OF THE CREATED USER =>>> " . $userId . "<br/>"; echo "<br/>GETTING A USER BY ID<br/>"; $response = $api->getUser($userId); echo print_r($response, true) . "<br/>"; echo "USER =>>> " . print_r($response->response->user, true) . "<br/>"; echo "<br/>UPDATING A USER<br/>"; $response = $api->editUser($userId, "loginNew", "*****@*****.**", 98765432112, null, null, null, false); echo print_r($response, true) . "<br/>"; echo "UPDATED USER =>>> " . print_r($response->response->user, true) . "<br/>"; echo "<br/>GETTING A LIST OF USERS<br/>"; $response = $api->getUsers(0); echo print_r($response, true) . "<br/>"; echo "USERS =>>> " . print_r($response->response->users, true) . "<br/>"; echo "<br/>GETTING A QUANTITY OF USERS<br/>"; $response = $api->getUsersQuantity(); echo print_r($response, true) . "<br/>"; $quantity = $response->response->quantity; echo "USERS QUANTITY =>>> " . $quantity . "<br/>"; echo "<br/>CREATING A TOKEN<br/>"; $response = $api->addSoftwareToken(null, null, "MAIL", "*****@*****.**", "Mail token", null, null, null, null, null, null); echo print_r($response, true) . "<br/>"; $tokenId = $response->response->id; echo "ID OF THE CREATED TOKEN =>>> " . $tokenId . "<br/>"; echo "<br/>ASSIGNING TOKEN WITH ID = " . $tokenId . " TO USER WITH ID = " . $userId . "<br/>"; // assigns token to user $response = $api->assignUserToken($userId, $tokenId);