/** * Authenticate to the API * * @return boolean */ private function logOnClient() { $logOnRequest = new LogOnRequest(); $logOnRequest->UserName = $this->config->getUserName(); $logOnRequest->Password = $this->config->getPassword(); $LogOnResponse = $this->client->logOn($logOnRequest->jsonSerialize()); if ($LogOnResponse->IsSuccess) { $this->setHeader('SecurityToken', $LogOnResponse->SecurityToken); $this->client->setDefaultOption('headers', $this->getHeaders()); return true; } else { return false; } }