Get Started with the API

After a Hydrolix environment is created, you will have a URL, username, and password.

The first tasks in Hydrolix are:

  1. Login to Hydrolix via API
  2. Create a Project via API
  3. Create a Table
  4. Decide how to Ingest Data
  5. Create a Transform (Optional)
  6. Create a View

The Hydrolix environment set up is initiated by contacting support@hydrolix.io.


Login

Login API

Login is required for Hydrolix use. For API calls, an authorization token is required for each call.

The document returned has two values needed for further API requests, the organization UUID and the access token.

{
    "uuid": "the-user-uuid",
    "orgs": [
        {
            "uuid": "THE ORG ID FOR API CALLS",
            "name": "my_org",
            "type": "singletenant"
        }
    ],
    "auth_token": {
        "access_token": "THE TOKEN FOR API CALLS",
        "expires_in": 3600,
        ...
    }
}

Create Project

To create a project, a call is made to the create project API.

Required:

  • an acccess_token from login
  • UUID of the organization where the project should be created
  • a name for the project

The organization UUID is specified in the path as well as in the request document.

The response will carry a UUID for the project. This will be needed for project operations, like creating tables.

{
    "uuid": "the-project-uuid",
    "name": "firstproject",
    "description": "stuff",
    "created": "2020-05-04T23:08:11.488083Z",
    "modified": "2020-05-04T23:08:11.488104Z",
    "org": "the-org-uuid-from-request"
}

Create Table

To create a table, a call is made to the create table API.

Required:

  • an acccess_token from login
  • UUID of the organization where the table should be created
  • UUID of the project where the table should be created
  • a name for the table

The project UUID is specified in the path as well as in the request document. The organization UUID is required in the path.

The response will carry a UUID for the table. This will be needed for table operations, like creating transforms and views.

{
    "uuid": "the-table-uuid",
    "name": "myTable",
    "description": "my first table",
    "created": "2020-05-04T23:20:04.334094Z",
    "modified": "2020-05-04T23:20:04.334126Z",
    "settings": {
        "index": {}
    },
    "project": "the-project-uuid-from-request"
}

Decide How to Ingest Data

Once you have a table, you can ingest some data. Data can be streamed to Hydrolix or sent in batch. Ingesting data requires a transform, that can be created ahead of time, or, in the case of streaming, can be defined on the fly.

Create an Ingest Transform (Optional)

If you are ingesting data via batch, or not using self-described streaming, you will need a transform before you can ingest data.

To create a ingest transform, a call is made to the create transform API.

Required:

  • an acccess_token from login
  • UUID of the organization
  • UUID of the project
  • UUID of the table
  • a name for the transform
  • output_columns
  • type

The table UUID is specified in the path as well as in the request document. The organization and project UUIDs are required in the path.

Example create transform request document

{
    "name": "the_first_transform",
    "type": "json",
    "table": "f9be7438-5d9f-499a-8fda-b5a37df4ece0",
    "description": "the first transform I made",
    "settings": {
        "output_columns": [
        {
        "name": "timestamp",
        "type": "datetime",
        "format": "2006-01-02 15:04:03 MST",
        "treatment": "primary"
      },
		... ],
			...}
}


Create a Query View

To create a query view, a call is made to the create view API.

Required:

  • an acccess_token from login
  • UUID of the organization
  • UUID of the project
  • UUID of the table
  • a name for the view
  • output_columns

The table UUID is specified in the path as well as in the request document. The organization and project UUIDs are required in the path.

Example create view request document

{
    "name": "the_first_transform",
    "type": "json",
    "table": "f9be7438-5d9f-499a-8fda-b5a37df4ece0",
    "description": "the first transform I made",
    "settings": {
        "output_columns": [
        {
        "name": "timestamp",
        "type": "datetime",
        "format": "2006-01-02 15:04:03 MST",
        "treatment": "primary"
      },
		... ],
			...}
}


What’s Next?

Time to ingest some data!