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 TVSession();
	//...


Creating a session for another userId


	<?php
	//...
	$Session_2 = new TVSession(['userId' => $userId, 'accessToken' => $accessToken]);
	//...