Menu

## APIClient

APIClient.php : 25

HEXONET APIClient

### Table of Contents

$curlopts : array<string|int, mixed>
  additional curl options to use
$debugMode : bool
  activity flag for debug mode
$logger : Logger
  logger function name for debug mode
$socketConfig : SocketConfig
  Object covering API connection data
$socketTimeout : int
  API connection timeout setting
$socketURL : string
  API connection url
$ua : string
  user agent
__construct() : mixed
disableDebugMode() : $this
  Disable Debug Output
enableDebugMode() : $this
  Enable Debug Output to STDOUT
getPOSTData() : string
  Serialize given command for POST request including connection configuration data
getProxy() : string|null
  Get proxy configuration for API communication
getReferer() : string|null
  Get Referer configuration for API communication
getSession() : string|null
  Get the API Session ID that is currently set
getURL() : string
  Get the API connection url that is currently set
getUserAgent() : string
  Get the user agent string
getVersion() : string
  Get the current module version
login() : Response
  Perform API login to start session-based communication
loginExtended() : Response
  Perform API login to start session-based communication.
logout() : Response
  Perform API logout to close API session in use
request() : Response
  Perform API request using the given command
requestAllResponsePages() : array<string|int, Response>
  Request all pages/entries for the given query command
requestNextResponsePage() : Response|null
  Request the next page of list entries for the current list query Useful for tables
resetUserView() : $this
  Reset data view back from subuser to user
reuseSession() : $this
  Use existing configuration out of php session object to rebuild and reuse connection settings
saveSession() : $this
  Apply session data (session id and system entity) to given php session object
setCredentials() : $this
  Set Credentials to be used for API communication
setCustomLogger() : $this
  set custom logger to use instead of default one create your own class inheriting from \HEXONET\Logger and overriding method log
setDefaultLogger() : $this
  set default logger to use
setOTP() : $this
  Set one time password to be used for API communication
setProxy() : $this
  Set proxy to use for API communication
setReferer() : $this
  Set Referer to use for API communication
setRemoteIPAddress() : $this
  Set an Remote IP Address to be used for API communication To be used in case you have an active ip filter setting.
setRoleCredentials() : $this
  Set Credentials to be used for API communication
setSession() : $this
  Set an API session id to be used for API communication
setURL() : $this
  Set another connection url to be used for API communication
setUserAgent() : $this
  Set a custom user agent (for platforms that use this SDK)
setUserView() : $this
  Set a data view to a given subuser
useDefaultConnectionSetup() : $this
  Activate Default Connection Setup (which is the default anyways)
useHighPerformanceConnectionSetup() : $this
  Activate High Performance Setup
useLIVESystem() : $this
  Set LIVE System for API communication (this is the default setting)
useOTESystem() : $this
  Set OT&E System for API communication
autoIDNConvert() : array<string|int, mixed>
  Auto convert API command parameters to punycode, if necessary.
flattenCommand() : array<string|int, mixed>
  Flatten API command's nested arrays for easier handling

### Properties

#### $curlopts

APIClient.php : 56

additional curl options to use

`private array<string|int, mixed> $curlopts = []`

#### $debugMode

APIClient.php : 46

activity flag for debug mode

`private bool $debugMode`

#### $logger

APIClient.php : 61

logger function name for debug mode

`private Logger $logger`

#### $socketConfig

APIClient.php : 41

Object covering API connection data

`private SocketConfig $socketConfig`

#### $socketTimeout

APIClient.php : 31

API connection timeout setting

`private static int $socketTimeout = 300000`

#### $socketURL

APIClient.php : 36

API connection url

`private string $socketURL`

#### $ua

APIClient.php : 51

user agent

`private string $ua`

### Methods

#### __construct()

APIClient.php : 63
`public __construct() : mixed`

##### Return values

mixed —

#### disableDebugMode()

APIClient.php : 110

Disable Debug Output

`public disableDebugMode() : $this`

##### Return values

$this —

#### enableDebugMode()

APIClient.php : 100

Enable Debug Output to STDOUT

`public enableDebugMode() : $this`

##### Return values

$this —

#### getPOSTData()

APIClient.php : 122

Serialize given command for POST request including connection configuration data

`public getPOSTData(string|array<string|int, mixed> $cmd[, bool $secured = false ]) : string`

##### Parameters

$cmd : string|array<string|int, mixed>

  API command to encode

$secured : bool = false

  secure password (when used for output)

##### Return values

string —

encoded POST data string

#### getProxy()

APIClient.php : 209

Get proxy configuration for API communication

`public getProxy() : string|null`

##### Return values

string|null —

#### getReferer()

APIClient.php : 232

Get Referer configuration for API communication

`public getReferer() : string|null`

##### Return values

string|null —

#### getSession()

APIClient.php : 151

Get the API Session ID that is currently set

`public getSession() : string|null`

##### Return values

string|null —

API Session ID currently in use

#### getURL()

APIClient.php : 161

Get the API connection url that is currently set

`public getURL() : string`

##### Return values

string —

API connection url currently in use

#### getUserAgent()

APIClient.php : 186

Get the user agent string

`public getUserAgent() : string`

##### Return values

string —

user agent string

#### getVersion()

APIClient.php : 244

Get the current module version

`public getVersion() : string`

##### Return values

string —

module version

#### login()

APIClient.php : 351

Perform API login to start session-based communication

`public login([string $otp = "" ]) : Response`

##### Parameters

$otp : string = ""

  optional one time password

##### Return values

Response —

Response

#### loginExtended()

APIClient.php : 369

Perform API login to start session-based communication.

`public loginExtended(array<string|int, mixed> $params[, string $otp = "" ]) : Response`

Use given specific command parameters.

##### Parameters

$params : array<string|int, mixed>

  given specific command parameters

$otp : string = ""

  optional one time password

##### Return values

Response —

Response

#### logout()

APIClient.php : 387

Perform API logout to close API session in use

`public logout() : Response`

##### Return values

Response —

Response

#### request()

APIClient.php : 476

Perform API request using the given command

`public request(array<string|int, mixed> $cmd) : Response`

##### Parameters

$cmd : array<string|int, mixed>

  API command to request

##### Return values

Response —

Response

#### requestAllResponsePages()

APIClient.php : 558

Request all pages/entries for the given query command

`public requestAllResponsePages(array<string|int, mixed> $cmd) : array<string|int, Response>`

##### Parameters

$cmd : array<string|int, mixed>

  API list command to use

##### Return values

array<string|int, Response> —

Responses

#### requestNextResponsePage()

APIClient.php : 531

Request the next page of list entries for the current list query Useful for tables

`public requestNextResponsePage(Response $rr) : Response|null`

##### Parameters

$rr : Response

  API Response of current page

##### Tags

throws
  Exception

  in case Command Parameter LAST is in use while using this method

##### Return values

Response|null —

Response or null in case there are no further list entries

#### resetUserView()

APIClient.php : 586

Reset data view back from subuser to user

`public resetUserView() : $this`

##### Return values

$this —

#### reuseSession()

APIClient.php : 269

Use existing configuration out of php session object to rebuild and reuse connection settings

`public reuseSession(array<string|int, mixed> &$session) : $this`

##### Parameters

$session : array<string|int, mixed>

  php session object ($_SESSION)

##### Return values

$this —

#### saveSession()

APIClient.php : 254

Apply session data (session id and system entity) to given php session object

`public saveSession(array<string|int, mixed> &$session) : $this`

##### Parameters

$session : array<string|int, mixed>

  php session instance ($_SESSION)

##### Return values

$this —

#### setCredentials()

APIClient.php : 327

Set Credentials to be used for API communication

`public setCredentials(string $uid, string $pw) : $this`

##### Parameters

$uid : string

  account name

$pw : string

  account password

##### Return values

$this —

#### setCustomLogger()

APIClient.php : 80

set custom logger to use instead of default one create your own class inheriting from \HEXONET\Logger and overriding method log

`public setCustomLogger(Logger $customLogger) : $this`

##### Parameters

$customLogger : Logger

##### Return values

$this —

#### setDefaultLogger()

APIClient.php : 90

set default logger to use

`public setDefaultLogger() : $this`

##### Return values

$this —

#### setOTP()

APIClient.php : 292

Set one time password to be used for API communication

`public setOTP(string $value) : $this`

##### Parameters

$value : string

  one time password

##### Return values

$this —

#### setProxy()

APIClient.php : 199

Set proxy to use for API communication

`public setProxy(string $proxy) : $this`

##### Parameters

$proxy : string

  proxy to use

##### Return values

$this —

#### setReferer()

APIClient.php : 222

Set Referer to use for API communication

`public setReferer(string $referer) : $this`

##### Parameters

$referer : string

  Referer

##### Return values

$this —

#### setRemoteIPAddress()

APIClient.php : 315

Set an Remote IP Address to be used for API communication To be used in case you have an active ip filter setting.

`public setRemoteIPAddress(string $value) : $this`

##### Parameters

$value : string

  Remote IP Address

##### Return values

$this —

#### setRoleCredentials()

APIClient.php : 341

Set Credentials to be used for API communication

`public setRoleCredentials(string $uid, string $role, string $pw) : $this`

##### Parameters

$uid : string

  account name

$role : string

  role user id

$pw : string

  role user password

##### Return values

$this —

#### setSession()

APIClient.php : 303

Set an API session id to be used for API communication

`public setSession(string $value) : $this`

##### Parameters

$value : string

  API session id

##### Return values

$this —

#### setURL()

APIClient.php : 281

Set another connection url to be used for API communication

`public setURL(string $value) : $this`

##### Parameters

$value : string

  API connection url to set

##### Return values

$this —

#### setUserAgent()

APIClient.php : 173

Set a custom user agent (for platforms that use this SDK)

`public setUserAgent(string $str, string $rv[, array<string|int, mixed> $modules = [] ]) : $this`

##### Parameters

$str : string

  user agent label

$rv : string

  user agent revision

$modules : array<string|int, mixed> = []

  further modules to add to user agent string, format: ["/", "/", ... ]

##### Return values

$this —

#### setUserView()

APIClient.php : 576

Set a data view to a given subuser

`public setUserView([string $uid = "" ]) : $this`

##### Parameters

$uid : string = ""

  subuser account name

##### Return values

$this —

#### useDefaultConnectionSetup()

APIClient.php : 607

Activate Default Connection Setup (which is the default anyways)

`public useDefaultConnectionSetup() : $this`

##### Return values

$this —

#### useHighPerformanceConnectionSetup()

APIClient.php : 596

Activate High Performance Setup

`public useHighPerformanceConnectionSetup() : $this`

##### Return values

$this —

#### useLIVESystem()

APIClient.php : 627

Set LIVE System for API communication (this is the default setting)

`public useLIVESystem() : $this`

##### Return values

$this —

#### useOTESystem()

APIClient.php : 617

Set OT&E System for API communication

`public useOTESystem() : $this`

##### Return values

$this —

#### autoIDNConvert()

APIClient.php : 425

Auto convert API command parameters to punycode, if necessary.

`private autoIDNConvert(array<string|int, mixed>|string $cmd) : array<string|int, mixed>`

##### Parameters

$cmd : array<string|int, mixed>|string

  API command

##### Return values

array<string|int, mixed> —

#### flattenCommand()

APIClient.php : 401

Flatten API command's nested arrays for easier handling

`private flattenCommand(array<string|int, mixed> $cmd) : array<string|int, mixed>`

##### Parameters

$cmd : array<string|int, mixed>

  API Command

##### Return values

array<string|int, mixed> —

## Search results