HTTP Interface

The HTTP interface lets you use JoinBase on any platform from any programming language in a form of REST API.

🔍

All TCP based interfaces supports two modes: plain or TLS, plain is ok for . But, generally, the TLS interface is recommended for production.

Primary

  1. Query (Data Reading)
GET / or /?param1=a&param2=2... 
[body: select/show/desc statement]

The path of a query must be "/". The parameters are optional. Now we support the following parameters: database, output_layout and output_format, username, password.

ParametersMQTT Message
databasethe name of database.
default value: default,
allowed values: n/a
output_layoutthe memory layout of output.
default value: rowwise
allowed values:rowwise,columnwise
output_formatthe memory layout of output.
default value: rowwise
allowed values:json,csv
username/passwordthe username/password for authentication.
(We do not recommend using this method as the parameter might be logged by web proxy and cached in the browser)
  1. Data ingestion (Data Writing)
POST /database/table
[body: csv or json payload]

The path of a query must be a valid topic or topic alias.

  1. DDL(Data Definition Language)/Schema Change

See more in the document of advanced features.

  1. Authentication

The two simple authentication methods in the HTTP interface are supported:

a. Using ‘X-JoinBase-User’ and ‘X-JoinBase-Key’ headers. Example:

b. In the ‘user’ and ‘password’ URL parameters. (We do not recommend using this method as the parameter might be logged by web proxy and cached in the browser).

🔍

The security philosophy of JoinBase is whitelist-based. So the authentication is the must in any interface.

Examples

  1. Query
curl -s -H 'X-JoinBase-User: abc' -H 'X-JoinBase-Key: abc' -X GET 'http://127.0.0.1:8080/' -d 'select 123'|json_pp
  1. Desc table
curl -s -H 'X-JoinBase-User: abc' -H 'X-JoinBase-Key: abc' -X GET 'http://127.0.0.1:8080/?database=abc' -d 'desc table t'|json_pp
  1. Ingest data
curl -s -H 'X-JoinBase-User: abc' -H 'X-JoinBase-Key: abc'  -X POST 'http://127.0.0.1:8080/abc/t' -d '3,4
5,6'

Predefined Query

See more in the document of advanced features.