protected function getTokenFormApi()
    {
        $http = $this->getHttp();

        $token = $http->parseJson($http->post(self::API_TOKEN_URI, [
            'grant_type' => 'client_credentials',
            'client_id'  => $this->getAppKey(),
            'client_secret' => $this->getSecretKey()
        ]));

        if (empty($token[$this->tokenSucessKey])) {
            throw new RuntimeException('Request AccessToken fail. response: '.json_encode($token, JSON_UNESCAPED_UNICODE));
        }

        return $token;
    }
protected function getTokenFormApi()
    {
        $http = $this->getHttp();

        $token = $http->parseJson($http->post(self::API_TOKEN_URI, [
            'grant_type' => 'client_credentials',
            'client_id'  => $this->getAppKey(),
            'client_secret' => $this->getSecretKey()
        ]));

        if (empty($token[$this->tokenSucessKey])) {
            throw new RuntimeException('Request AccessToken fail. response: '.json_encode($token, JSON_UNESCAPED_UNICODE));
        }

        return $token;
    }
protected function getTokenFormApi ( ) { $ http = $ this -> getHttp ( ) ; $ token = $ http -> parseJson ( $ http -> post ( self :: API_TOKEN_URI , [ 'grant_type' => 'client_credentials' , 'client_id' => $ this -> getAppKey ( ) , 'client_secret' => $ this -> getSecretKey ( ) ] ) ) ; if ( empty ( $ token [ $ this -> tokenSucessKey ] ) ) { throw new RuntimeException ( 'Request AccessToken fail. response: ' . json_encode ( $ token , JSON_UNESCAPED_UNICODE ) ) ; } return $ token ; }
Get Token From Api.

@throws  \Exception

@return array
Get Token From Api .