protected function buildQuery($id = null, $action = null, array $parameters = array())
    {
        $parameters = http_build_query(array_merge($parameters, $this->credentials));

        $query = $id ? sprintf("%s/%s", $this->apiUrl, $id) : $this->apiUrl;
        $query = $action ? sprintf("%s/%s/?%s", $query, $action, $parameters) : sprintf("%s/?%s", $query, $parameters);

        return $query;
    }