public function getToken()
    {
        if (!$this->_restclient) {
            $this->_restclient = new RestClient();
        }
        $data = ['grant_type'    => 'client_credentials',
            'client_id'     => $this->get('CLIENT_ID'),
            'client_secret' => $this->get('CLIENT_SECRET')];
        $this->_restclient->setHttpParam('address', $this->get('base_url'));
        $response = $this->_restclient->post("/oauth/token", ['json_data' => json_encode($data)]);
        return $response['body'];
    }
public function getToken()
    {
        if (!$this->_restclient) {
            $this->_restclient = new RestClient();
        }
        $data = ['grant_type'    => 'client_credentials',
            'client_id'     => $this->get('CLIENT_ID'),
            'client_secret' => $this->get('CLIENT_SECRET')];
        $this->_restclient->setHttpParam('address', $this->get('base_url'));
        $response = $this->_restclient->post("/oauth/token", ['json_data' => json_encode($data)]);
        return $response['body'];
    }
public function getToken ( ) { if ( ! $ this -> _restclient ) { $ this -> _restclient = new RestClient ( ) ; } $ data = [ 'grant_type' => 'client_credentials' , 'client_id' => $ this -> get ( 'CLIENT_ID' ) , 'client_secret' => $ this -> get ( 'CLIENT_SECRET' ) ] ; $ this -> _restclient -> setHttpParam ( 'address' , $ this -> get ( 'base_url' ) ) ; $ response = $ this -> _restclient -> post ( "/oauth/token" , [ 'json_data' => json_encode ( $ data ) ] ) ; return $ response [ 'body' ] ; }
Obtain token with key and secret
@return mixed
Obtain token with key and secret