Open session

				
					string sessionOpen(string name, string key, array preferences)
				
			

Returns information about the requested API session.

Return the information of the requested session.

REQUIRED

  • name string (8)
    API user name
  • key string
    API access key
OPTIONAL

  • preferences array
    Session preferences
  • preferences.lang string (2)
    Language in which the API will respond (EN, FR)
  • preferences.sync integer (1)
    Asynchronous or synchronous processing of operations (0, 1)
  • preferences.syncDelay integer
    Maximum waiting time for return of synchronous operations (-1 – 127)
  • preferences.notif integer (1)
    Disable or enable operation notifications (0, 1)

String (32) containing a session ID

The session ID must be kept for next function calls.

$soapClient = new SoapClient('https://URL.wsdl');

$preferences = [
    'lang' => 'EN',
    'sync' => 1,
    'notif' => 0,
];

try {
    $sessionID = $soapClient->sessionOpen('AA001_user', 'xxxxxxxxxx', $preferences);

} catch (SoapFault $fault) {
    echo 'SoapFault : ' . $fault->getMessage(). "\n";
}

if (isset($sessionID)) {
    $soapClient->sessionClose($sessionID);
}