Change language settings to use Topvisor in your preferred language. You can select and set a preferred language later in the Account settings. Change language settings to use Topvisor in your preferred language. ru Русский Apply

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