src/Bridge.php
public function fetchToken($incrementThrottle = false)
    {
        // Increment throttle if needed.
        if ($incrementThrottle) {
            $this->incrementThrottle();
        }
        // Reset Client.
        $this->setClient($this->getAuthorizationEndpoint());
        // Get the token response.
        $response = $this->get('v1/token', [
            'url' => $this->endpoint,
        ]);
        // Extract.
        $token = json_decode($response->getBody()->getContents(), true);
        // Reset client.
        $this->setClient($this->endpoint);
        // Update token.
        $this->token->updateToken($token['token']);
    }
public function fetchToken($incrementThrottle = false)
    {
        // Increment throttle if needed.
        if ($incrementThrottle) {
            $this->incrementThrottle();
        }
        // Reset Client.
        $this->setClient($this->getAuthorizationEndpoint());
        // Get the token response.
        $response = $this->get('v1/token', [
            'url' => $this->endpoint,
        ]);
        // Extract.
        $token = json_decode($response->getBody()->getContents(), true);
        // Reset client.
        $this->setClient($this->endpoint);
        // Update token.
        $this->token->updateToken($token['token']);
    }
public function fetchToken ( $ incrementThrottle = false ) { // Increment throttle if needed. if ( $ incrementThrottle ) { $ this -> incrementThrottle ( ) ; } // Reset Client. $ this -> setClient ( $ this -> getAuthorizationEndpoint ( ) ) ; // Get the token response. $ response = $ this -> get ( 'v1/token' , [ 'url' => $ this -> endpoint , ] ) ; // Extract. $ token = json_decode ( $ response -> getBody ( ) -> getContents ( ) , true ) ; // Reset client. $ this -> setClient ( $ this -> endpoint ) ; // Update token. $ this -> token -> updateToken ( $ token [ 'token' ] ) ; }
Fetch token from Watson and Save it locally.

@param bool $incrementThrottle

@return void
Fetch token from Watson and Save it locally .