protected function requestAccessToken()
    {
        $options = [
            'form_params' => [
                'grant_type'    => 'client_credentials',
                'client_id'     => $this->getApiKey(),
                'client_secret' => $this->getApiSecret(),
            ],
        ];

        $result = (new Client())->post($this->getApiAccessTokenUrl(), $options);

        if (200 === $result->getStatusCode()) {
            return Access::fromJson(json_decode($result->getBody()->getContents()));
        } else {
            throw new \HttpResponseException('Invalid Response');
        }
    }
protected function requestAccessToken()
    {
        $options = [
            'form_params' => [
                'grant_type'    => 'client_credentials',
                'client_id'     => $this->getApiKey(),
                'client_secret' => $this->getApiSecret(),
            ],
        ];

        $result = (new Client())->post($this->getApiAccessTokenUrl(), $options);

        if (200 === $result->getStatusCode()) {
            return Access::fromJson(json_decode($result->getBody()->getContents()));
        } else {
            throw new \HttpResponseException('Invalid Response');
        }
    }
protected function requestAccessToken ( ) { $ options = [ 'form_params' => [ 'grant_type' => 'client_credentials' , 'client_id' => $ this -> getApiKey ( ) , 'client_secret' => $ this -> getApiSecret ( ) , ] , ] ; $ result = ( new Client ( ) ) -> post ( $ this -> getApiAccessTokenUrl ( ) , $ options ) ; if ( 200 === $ result -> getStatusCode ( ) ) { return Access :: fromJson ( json_decode ( $ result -> getBody ( ) -> getContents ( ) ) ) ; } else { throw new \ HttpResponseException ( 'Invalid Response' ) ; } }
Request an Access Token from Blizzard

@return Access

@throws \HttpResponseException
Request an Access Token from Blizzard