private function buildUrl($path) {
        $key = $this->patrol->getApiKey();
        $secret = $this->patrol->getApiSecret();

        $base = $this->patrol->apiBase;

        $url = $base . '/' . $path . '?key=' . $key . '&secret=' . $secret;

        if ($this->method === "get" && !is_null($this->payload)) {
            $query = http_build_query($this->payload);
            $url .= '&' . $query;
        }

        if (count($this->scopes)) {
            $scopes = implode(',', $this->scopes);
            if ($scopes) {
                $url .= '&scope=' . $scopes;
            }
        }

        $this->url = $url;
    }