Rest APIs for Queries and Data Sets

What is the {DREMIO_ORIGIN} URL is it localhost:9047. It gives me 404 error when I try to access it

product: dremio-community-1.4.4-201801230630490666-6d69d32

I tried http://localhost:9047/api/v3

1 Like

It is the URL you use to access Dremio - so if you use localhost:9047 then the source api would be http://localhost:9047/api/v3/source

You will have to authenticate first as described in the docs or you will get access denied errors.

1 Like

Here is what I get when I try to login. Am I doing it the right way

Hi,

Looks like you are not sending a Content-Type header. Since you are submitting JSON you will need to send Content-Type: application/json to the REST endpoint.

I am getting unauthorized 401 error. Is this the right way

Hi,

In our documentation, curly braces ({}) are used to indicate sections of URLs/values where you have to supply a value. What is confusing many people is that you are meant replace the curly brackets as well.

So in this case your should remove the curly braces and the " in the Authorization header. We are working on making that clearer as we have some confusion around that.

1 Like

Thanks Doron, I finally got it to work,

Another question: If I do a select against the database table on this screen , I have the option of downloading a json file. Is there a way to use a rest api GET operation to get the data dynamically instead of downloading a json file
image

At this time the only way to get your results as JSON is by downloading the file.

Is your real goal to issue a query via REST and have the response come back as JSON? I ask because the download is limited to 1M records, and lately I’ve had a few people ask for a JSON response type for query results.

Today you can issue queries via ODBC/JDBC, and those protocols aren’t really aligned with JSON as a response format. We’ll have a way to issue queries and receive results via REST fairly soon. Querying via REST would be the most likely way we could implement a JSON result format option.

Or perhaps you’re trying to do something else?

Yes, I am looking at Dremio providing features similar to Tibco/Cisco Composite where I can create a query and expose the results as via a Rest API in JSON format that includes all operations (GET, POST …)

OK, that’s helpful.

We aren’t too far away from being to accept queries via REST, but Dremio currently has no plans to handle writes to the underlying sources.

I think it’s also good to point out Dremio is designed to do much more than traditional data virtualization like Composite, including:

  • data curation
  • data acceleration
  • data lineage
  • deep support for modern sources like MongoDB, Elasticsearch, HDFS, S3, etc.
  • self-service model
  • open source

To name a few things. Hopefully this is in line with your needs. However, if you want to process writes through Dremio, that’s not currently in our plans for the product.

I am ok with Read Only for now. There is another bug which I not been able to figure out.

I have a database with more than 35 schemas. The form that initially connects to the database doesn’t bring out more than 38. is that by design?

Here is the screenshot. The Schema list stops at DM

Would you mind starting this as a separate topic and please provide the data source type and version you are trying to access.

Thanks!

Doron,
Thanks for clearing that up, the documentation was not clear. After removing the {} I got my request to work.