src/SendPulseApi.php
private function getToken() {
        $data = array(
            'grant_type'    => 'client_credentials',
            'client_id'     => $this->userId,
            'client_secret' => $this->secret,
        );

        $requestResult = $this->sendRequest( 'oauth/access_token', 'POST', $data, false );

        if( $requestResult->http_code != 200 ) {
            return false;
        }

        $this->refreshToken = 0;
        $this->token = $requestResult->data->access_token;

        $this->storage->set($this->token);

        return true;
    }
private function getToken() {
        $data = array(
            'grant_type'    => 'client_credentials',
            'client_id'     => $this->userId,
            'client_secret' => $this->secret,
        );

        $requestResult = $this->sendRequest( 'oauth/access_token', 'POST', $data, false );

        if( $requestResult->http_code != 200 ) {
            return false;
        }

        $this->refreshToken = 0;
        $this->token = $requestResult->data->access_token;

        $this->storage->set($this->token);

        return true;
    }
Get token and store it

@return bool