src/FlexiPeeHP/FlexiBeeRO.php
public function requestAuthSessionID($username, $password, $otp = null)
    {
        $this->postFields = http_build_query(is_null($otp) ? ['username' => $username,
            'password' => $password] : ['username' => $username, 'password' => $password,
            'otp' => $otp]);
        $response         = $this->performRequest('/login-logout/login', 'POST',
            'json');
        if (array_key_exists('refreshToken', $response)) {
            $this->refreshToken = $response['refreshToken'];
        } else {
            $this->refreshToken = null;
        }
        return array_key_exists('authSessionId', $response) ? $response['authSessionId']
                : null;
    }
public function requestAuthSessionID($username, $password, $otp = null)
    {
        $this->postFields = http_build_query(is_null($otp) ? ['username' => $username,
            'password' => $password] : ['username' => $username, 'password' => $password,
            'otp' => $otp]);
        $response         = $this->performRequest('/login-logout/login', 'POST',
            'json');
        if (array_key_exists('refreshToken', $response)) {
            $this->refreshToken = $response['refreshToken'];
        } else {
            $this->refreshToken = null;
        }
        return array_key_exists('authSessionId', $response) ? $response['authSessionId']
                : null;
    }
public function requestAuthSessionID ( $ username , $ password , $ otp = null ) { $ this -> postFields = http_build_query ( is_null ( $ otp ) ? [ 'username' => $ username , 'password' => $ password ] : [ 'username' => $ username , 'password' => $ password , 'otp' => $ otp ] ) ; $ response = $ this -> performRequest ( '/login-logout/login' , 'POST' , 'json' ) ; if ( array_key_exists ( 'refreshToken' , $ response ) ) { $ this -> refreshToken = $ response [ 'refreshToken' ] ; } else { $ this -> refreshToken = null ; } return array_key_exists ( 'authSessionId' , $ response ) ? $ response [ 'authSessionId' ] : null ; }
Request authSessionId from current server

@link https://www.flexibee.eu/api/dokumentace/ref/login/ description

@param string $username
@param string $password
@param string $otp       optional onetime password

@return string authUserId or null in case of problems
Request authSessionId from current server