PHP SDK by HEXONET

APIClient

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

additional curl options to use

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

$debugMode

activity flag for debug mode

private bool $debugMode

$socketTimeout

API connection timeout setting

private static int $socketTimeout = 300000

$socketURL

API connection url

private string $socketURL

Methods

__construct()

public __construct() : mixed
Return values
mixed

disableDebugMode()

Disable Debug Output

public disableDebugMode() : $this
Return values
$this

enableDebugMode()

Enable Debug Output to STDOUT

public enableDebugMode() : $this
Return values
$this

getPOSTData()

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()

Get proxy configuration for API communication

public getProxy() : string|null
Return values
string|null

getReferer()

Get Referer configuration for API communication

public getReferer() : string|null
Return values
string|null

getSession()

Get the API Session ID that is currently set

public getSession() : string|null
Return values
string|null

API Session ID currently in use

getURL()

Get the API connection url that is currently set

public getURL() : string
Return values
string

API connection url currently in use

getUserAgent()

Get the user agent string

public getUserAgent() : string
Return values
string

user agent string

getVersion()

Get the current module version

public getVersion() : string
Return values
string

module version

login()

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()

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

request()

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()

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()

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()

Reset data view back from subuser to user

public resetUserView() : $this
Return values
$this

reuseSession()

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()

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()

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()

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()

set default logger to use

public setDefaultLogger() : $this
Return values
$this

setOTP()

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()

Set proxy to use for API communication

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

proxy to use

Return values
$this

setReferer()

Set Referer to use for API communication

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

Referer

Return values
$this

setRemoteIPAddress()

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()

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()

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()

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()

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()

Set a data view to a given subuser

public setUserView([string $uid = '' ]) : $this
Parameters
$uid : string = ''

subuser account name

Return values
$this

useDefaultConnectionSetup()

Activate Default Connection Setup (which is the default anyways)

public useDefaultConnectionSetup() : $this
Return values
$this

useHighPerformanceConnectionSetup()

Activate High Performance Setup

public useHighPerformanceConnectionSetup() : $this
Return values
$this

useLIVESystem()

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

public useLIVESystem() : $this
Return values
$this

useOTESystem()

Set OT&E System for API communication

public useOTESystem() : $this
Return values
$this

autoIDNConvert()

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()

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