protected function getDaxkoToken() {
    $time_start = microtime(true);
    $client = new Client(['base_uri' => $this->daxkoConfig->get('base_uri')]);
    $response = $client->request('POST', 'partners/oauth2/token',
      [
        'form_params' => [
          'client_id' => $this->daxkoConfig->get('user'),
          'client_secret' => $this->daxkoConfig->get('pass'),
          'grant_type' => 'client_credentials',
          'scope' => 'client:' . $this->daxkoConfig->get('client_id'),
        ],
        'headers' => [
          'Authorization' => "Bearer " . $this->daxkoConfig->get('referesh_token')
        ],
      ]);
    $time_end = microtime(true);
    $time = $time_end - $time_start;
    \Drupal::logger('openy_daxko2')->info('Daxko call. Time %times. URL %url', [
      '%time' => number_format($time, 2),
      '%url' => 'partners/oauth2/token',
    ]);

    return json_decode((string) $response->getBody())->access_token;
  }
protected function getDaxkoToken() {
    $time_start = microtime(true);
    $client = new Client(['base_uri' => $this->daxkoConfig->get('base_uri')]);
    $response = $client->request('POST', 'partners/oauth2/token',
      [
        'form_params' => [
          'client_id' => $this->daxkoConfig->get('user'),
          'client_secret' => $this->daxkoConfig->get('pass'),
          'grant_type' => 'client_credentials',
          'scope' => 'client:' . $this->daxkoConfig->get('client_id'),
        ],
        'headers' => [
          'Authorization' => "Bearer " . $this->daxkoConfig->get('referesh_token')
        ],
      ]);
    $time_end = microtime(true);
    $time = $time_end - $time_start;
    \Drupal::logger('openy_daxko2')->info('Daxko call. Time %times. URL %url', [
      '%time' => number_format($time, 2),
      '%url' => 'partners/oauth2/token',
    ]);

    return json_decode((string) $response->getBody())->access_token;
  }
protected function getDaxkoToken ( ) { $ time_start = microtime ( true ) ; $ client = new Client ( [ 'base_uri' => $ this -> daxkoConfig -> get ( 'base_uri' ) ] ) ; $ response = $ client -> request ( 'POST' , 'partners/oauth2/token' , [ 'form_params' => [ 'client_id' => $ this -> daxkoConfig -> get ( 'user' ) , 'client_secret' => $ this -> daxkoConfig -> get ( 'pass' ) , 'grant_type' => 'client_credentials' , 'scope' => 'client:' . $ this -> daxkoConfig -> get ( 'client_id' ) , ] , 'headers' => [ 'Authorization' => "Bearer " . $ this -> daxkoConfig -> get ( 'referesh_token' ) ] , ] ) ; $ time_end = microtime ( true ) ; $ time = $ time_end - $ time_start ; \ Drupal :: logger ( 'openy_daxko2' ) -> info ( 'Daxko call. Time %times. URL %url' , [ '%time' => number_format ( $ time , 2 ) , '%url' => 'partners/oauth2/token' , ] ) ; return json_decode ( ( string ) $ response -> getBody ( ) ) -> access_token ; }
Run querty to Daxko to get the token.
Run querty to Daxko to get the token .