Topvisor SDK::Session
Session defines a user that initiates requests.
The session is to be used to create API calls with the Pen object.
During initialization, it takes $auth array as an argument.
Default session
By default, $auth = NULL.
If $auth isn't specified explicitly, the authorization parameters specified in the config.ini file are to be used.
Session with other parameters
$auth is an array, it should include two elements: userId and accessToken.
Use an API Key as an accessToken. How do I get the API Key.
Examples
Creating a default session (config.php)
<?php
//...
$Session = new TV\Session();
//...
Creating a session for another userId
<?php
//...
$Session_2 = new TV\Session(['userId' => $userId, 'accessToken' => $accessToken]);
//...