›API reference

Get started

  • Introduction to Imply Polaris
  • Quickstart
  • Navigate the console
  • Key concepts

Data

  • Overview
  • Create a schema
  • Data partitioning
  • Introduction to rollup
  • Replace data
  • Supported data formats

Analytics

  • Overview
  • Manage data cubes
  • Visualize data
  • Dimensions
  • Measures
  • Dashboards
  • Visualizations reference
  • Query data

Monitoring

  • Overview

Management

  • Overview

Billing

  • Overview
  • Polaris plans
  • Estimate project costs
  • Manage billing and payments

Security

  • Overview
  • Add users to an organization
  • User roles reference
  • Manage user groups
  • Enable SSO
  • SSO settings reference

Developer guide

  • Overview
  • Authenticate API requests
  • Create a table
  • Get table ID
  • Define a schema
  • Upload files
  • Ingest to table
  • Push event data
  • Query data
  • Link to BI tools
  • Connect over JDBC

API reference

  • Overview
  • Reference index
  • Events API
  • Files API
  • Ingestion Jobs API
  • Ingestion Templates API
  • Performance API
  • Query API
  • Tables API
  • Common object definitions

    • Table
    • TableRequest
    • RollupSchema
    • IngestionJobSpec
    • CsvFormatSettings
    • JsonFormatSettings
    • TimestampMapping

Product info

  • Release notes
  • Known limitations

Files API

Use the Files API to upload files to a staging area for ingestion. See Upload files by API for more details and examples.

You can accomplish the following tasks with the Files API:

  • Upload a file
  • List available files
  • Get a file's metadata
  • Delete a file from the staging area

All URIs are relative to https://api.imply.io/v1

Upload a file

URL

POST /files

Parameters

Query parameters

  • dataFormat   type: String
    If specified, the format of the data. Otherwise, the data format is determined by the filename or content type associated with the file in the multipart form request. Supported options:

    • nd-json - newline-delimited JSON (one JSON record per line)
    • csv - CSV or TSV
  • compressionFormat   type: String
    If specified, the compression used for the file. Otherwise, the compression is determined by the filename or content type associated with the file in the multipart form request. Supported options:

    • bz2 - bzip2
    • gz - gzip
    • sz - Snappy framing format
    • xz - XZ Utils (previously LZMA Utils)
    • zstd - ZStandard

Request body

Send the file as form data in the request. File names must be unique in Polaris. You cannot upload a file if the staging already holds a file with the same name.

The media type of the HTTP request is multipart/form-data; however, you should not set the Content-Type: multipart/form-data header explicitly. Allow your client to assign the header automatically because it will also properly set the associated boundary directive.

You can upload a file up to 10 GB in size. This limit refers to the size of the file transmitted by the browser or HTTP client. You may upload a file that's larger than 10 GB on disk if your browser or client compresses the file in transit to below 10 GB.

Responses

A successful request returns an HTTP 2XX status code and a JSON response body of type FileMetadata.

201 SUCCESS
400 ERROR
409 ERROR
413 ERROR


Created.



Bad Request.



Conflict.



Payload Too Large.


Sample request

curl --location --request POST 'https://api.imply.io/v1/files' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: Bearer <Bearer Token>' \
--form 'file=@"mydata.csv"'

Sample response

{
    "id":"0600a548-5a66-40af-a93d-079d35a66fc5",
    "name":"mydata.csv",
    "sizeBytes":5573348,
    "dataFormat":"nd-json",
    "compressionFormat":"none",
    "digest":{
        "algo":"md5",
        "hash":"CDA9B678171E24BD956574E78659E0AD"
    },
    "uploadedByUserId":"dbb63d7c-3b35-4268-b351-17e0a98a7bfb",
    "uploadedOnDatetime":"2021-09-29T00:16:47.083004121Z"
}

List available files

URL

GET /files

Parameters

Query parameters

  • limit   type: Integer
    The maximum number of files to return at a time (max: 100)

  • cont   type: Integer
    An opaque continuation token (default: 0)

  • pattern   type: String
    A wildcard (glob) to match files

Responses

A successful request returns an HTTP 2XX status code and a JSON response body with the following properties:

  • files: An array of FileMetadata objects for every matching file.
  • links: Holds next and previous pagination links for paginated responses.
  • space: Information about the file repository, with the following fields:
    • allocatedByes: The total space allocated for the repository in bytes; sum of usedBytes and remainingBytes.
    • usedBytes: The amount of space used by files in the repository in bytes.
    • remainingBytes: The amount of unused space in the repository in bytes.
200 SUCCESS
400 ERROR


OK.



Invalid request payload.


Sample request

curl --location --request GET 'https://api.imply.io/v1/files' \
--header 'Authorization: Bearer <Bearer Token>'

Sample response

{
    "files": [
        {
            "id": "1645ac6e-5095-49bf-90ff-171dce77e66c",
            "name": "kttm-2019-08-19.json.gz",
            "sizeBytes": 8213401,
            "dataFormat": "nd-json",
            "compressionFormat": "gz",
            "digest": {
                "algo": "md5",
                "hash": "E370CAC6A8D6A938A08279200883D7B3"
            },
            "uploadedOnDatetime": "2021-09-29T23:20:24Z"
        },
        {
            "id": "55ef893a-4a53-4249-8fa6-b361eba31c39",
            "name": "wikipedia.zip",
            "sizeBytes": 2017143,
            "dataFormat": "nd-json",
            "compressionFormat": "none",
            "digest": {
                "algo": "md5",
                "hash": "B40356B48BF586043DA7F810027C4DFE"
            },
            "uploadedOnDatetime": "2021-10-07T05:52:59Z"
        }
    ],
    "space": {
        "allocatedBytes": 1000000000000,
        "usedBytes": 4972427805,
        "remainingBytes": 995027572195
    }
}

Get a file's metadata

URL

GET /files/{name}

Parameters

Path parameters

  • name   type: String   required
    Name of the file (may contain slashes)

Responses

A successful request returns an HTTP 2XX status code and a JSON response body of type FileMetadata.

200 SUCCESS
404 ERROR


OK.



Not Found.


Sample request

curl --location --request GET 'https://api.imply.io/v1/files/mydata.csv' \
--header 'Authorization: Bearer <Bearer Token>'

Sample response

{
    "id":"0600a548-5a66-40af-a93d-079d35a66fc5",
    "name":"mydata.csv",
    "sizeBytes":5573348,
    "dataFormat":"nd-json",
    "compressionFormat":"none",
    "digest":{
        "algo":"md5",
        "hash":"CDA9B678171E24BD956574E78659E0AD"
    },
    "uploadedByUserId":"dbb63d7c-3b35-4268-b351-17e0a98a7bfb",
    "uploadedOnDatetime":"2021-09-29T00:16:47.083004121Z",
    "modifiedByUserId":"dbb63d7c-3b35-4268-b351-17e0a98a7bfb",
    "modifiedOnDatetime":"2021-09-30T00:16:47.083004121Z"
}

Delete a file from the staging area

URL

DELETE /files/{name}

Parameters

Path parameters

  • name   type: String   required
    Name of the file (may contain slashes)

Responses

204 SUCCESS


No Content.


Sample request

curl --location --request DELETE 'https://api.imply.io/v1/files/mydata.csv' \
--header 'Authorization: Bearer <Bearer Token>'
← Events APIIngestion Jobs API →
  • Upload a file
    • URL
    • Parameters
    • Responses
    • Sample request
    • Sample response
  • List available files
    • URL
    • Parameters
    • Responses
    • Sample request
    • Sample response
  • Get a file's metadata
    • URL
    • Parameters
    • Responses
    • Sample request
    • Sample response
  • Delete a file from the staging area
    • URL
    • Parameters
    • Responses
    • Sample request
Key links
Try ImplyApache Druid siteImply GitHub
Get help
Stack OverflowSupportContact us
Learn more
BlogApache Druid docs
Copyright © 2022 Imply Data, Inc