echo "TOKEN =>>> " . print_r($response->response->token, true) . "<br/>"; echo "<br/>UPDATING A TOKEN<br/>"; $response = $api->editToken($tokenId, "Mail token new", false, false); echo print_r($response, true) . "<br/>"; echo "UPDATED TOKEN =>>> " . print_r($response->response->token, true) . "<br/>"; echo "<br/>GETTING A LIST OF TOKENS<br/>"; // gets a list of tokens descending (10 records starting from 'offset' parameter) $response = $api->getTokens(0); echo print_r($response, true) . "<br/>"; echo "TOKENS =>>> " . print_r($response->response->tokens, true) . "<br/>"; echo "<br/>GETTING A QUANTITY OF TOKENS<br/>"; $response = $api->getTokensQuantity(); echo print_r($response, true) . "<br/>"; $quantity = $response->response->quantity; echo "TOKENS QUANTITY =>>> " . $quantity . "<br/>"; echo "<br/>UNASSIGNING TOKEN WITH ID = " . $tokenId . " FROM USER, WHICH HAS THIS TOKEN<br/>"; // unassigns token from user $response = $api->unassignToken($tokenId); echo print_r($response, true) . "<br/>"; echo "<br/>DELETING A TOKEN<br/>"; $response = $api->deleteToken($tokenId); echo print_r($response, true) . "<br/>"; $tokenId = $response->response->token->id; echo "ID OF THE DELETED TOKEN =>>> " . $tokenId . "<br/>"; } catch (ProtectimusApiException $e) { echo "<br/><br/>"; echo "Error code => " . $e->errorCode . "<br/>"; echo "Error message => " . $e->getMessage() . "<br/>"; echo "Developer message => " . (!empty($e->developerMessage) ? $e->developerMessage : "") . "<br/>"; echo $e->getTraceAsString(); }