REST API documentation

Using API GUI
After logging in with the key provided to you, the homepage will show the tables available to view on the left hand side.
Database
Click on one of these tables to view the database
Request
Users can write simple SQL codes to filter selections. For example:
`Industry`= ‘CONSUMER STAPLES’ 
AND QMG < -10
AND `Stats Agency Period` = ’31/01/2016′
Type this and hit go and you will get the following result
SQL Code example
You can then hit the download button to pull down the data as a CSV.
The display rows field is for the the browser view only. Some browsers can be slow to render a large amount of data so you can change how much is shown on screen. The download itself will pull back data according to the filters set by the user.
Authentication

Authentication is achieved by adding the request header “X-Auth-Token” to every request made to the server.

Example: curl –header “X-Auth-Token: 12345″ http://myserver.com/db-rover/databases
Database list
Retrieves the list of available databases:
  • Request Format: http://<server name>[:port]/<context>/databases

  • Request Parameters: N/A

  • Response Format: [{"name":"<database name>", "description":"<database description>", "label":"<database label>"}, ...]

  • Request Example: http://myserver.com/db-rover/databases

  • Response Example: [{"name":"example_database", "description":"This is an example database", "label":"Example Database"}]

Table list

Retrieves a list of available tables for a database

  • Request Format: http://<server name>[:port]/<context>/databases/<database-name>

  • Request Parameters: <database-name> : Name of the database (see 2. above for listing available databases)

  • Response Format: [{"name":"<table name>", "columns":[{"name":"<column-name>", "type":"<column-type>"}, ...], “label”:”<table label>”,”description”:”<table description”}]

  • Request Example: http://myserver.com/db-rover/databases/example_database

  • Response Example: [{"name":"example_table","columns":[{"name":"example_int_column","type":"BIGINT"},{"name":"example_string_column","type":"VARCHAR"},...],”label”:”Example Table Label”,”description”:”Example Table Description”}]

Data retrieval 

Retrieves data bases on a where clause

  • Request Format: http://<server name>[:port]/<context>/databases/<database-name>/<table name>[?where=<sql where clause>]
  • Request Parameters:
    <database-name> : Name of the database (see 2. above for listing available databases)
    <table name> : Name of the table retrieve data from (see 3. above for listing available tables)
    <sql where clause> : Where clause. Most SQL where clauses are supported, see your database vendor for a complete list.
  • Request Example:
  1. Get all data: http://myserver.com/db-rover/databases/example_database/example_table
  2. Get data where “Example Column” equals “Example Value”: http://myserver.com/db rover/databases/example_database/example_table?where=%60Example%20Column%60%3D%27Example%20Value%27
  • Response Example:  [["Example Column 1","Example Column 2"],["Example Value Row 1 Column 1", "Example Value Row 1 Column 2"],["Example Value Row 2 Column 1", "Example Value Row 2 Column 2"]]

 

POWERED BY DB ROVER 

Leave a Reply

Your email address will not be published. Required fields are marked *


nine − = 7