Skip to main content

Metrics API v1

Introduction

This reference is your key to a comprehensive understanding of the Batu Metrics API.
❗ You need an integration token to interact with the Batu Metrics API. Contact us to request your integration key.

Conventions

The base URL to send all API requests is https://production.batuenergy.com and https://sandbox.batuenergy.com. HTTPS is required for all API requests. The Batu API follows RESTful conventions when possible, with most operations performed via GETPOSTPUT, and DELETE requests on page and database resources. Request and response bodies are encoded as JSON. JSON CONVENTIONS
  • JSend convention is used for responses.
  • Top-level resources have an "object" property. This property can be used to determine the type of the resource (e.g. "asset""metrics", etc.)
  • Top-level resources are addressable by a UUIDv4 "id" property. You may omit dashes from the ID when making requests to the API.
  • Uri paths and methods are in kebab-case(not camelCase or snake_case ).
  • Resource properties are in camelCase (not kebab-caseor snake_case ).
  • Temporal values (dates and datetimes) are encoded in ISO 8601 strings. Datetimes will include the time value (2020-08-12T02:12:33.231Z) while dates will include only the date (2020-08-12)
  • The Batu API does not support empty strings. To unset a string value for properties use an explicit null instead of "".

Code samples & SDKs

Samples requests and responses are shown for each endpoint. Requests are shown using cURL. These samples make it easy to copy, paste, and modify as you build your integration.

Pagination

Endpoints that return lists of objects support cursor-based pagination requests. By default, Batu returns up to 100 items per API call. If the number of items in a response from a support endpoint exceeds the default, then an integration can use pagination to request a specific set of the results and/or to limit the number of returned items.**** RESPONSES

Request Limits

To ensure a consistent developer experience for all API users, the Batu API is rate limited and basic size limits apply to request parameters.

Rate Limits

Rate-limited requests will return a "rate_limited" error code (HTTP response status 429). The rate limit for incoming requests per integration is an average of three requests per second. Some bursts beyond the average rate are allowed.
Rate limits may changeIn the future, we plan to adjust rate limits to balance for demand and reliability. We may also introduce distinct rate limits for workspaces in different pricing plans.

Status Codes

As per JSend, HTTP response codes are used to indicate general classes of success, failure, and error.

Success Code

Fail Codes

Fail responses contain more detail about the failure in the request body.

Error Codes

Error responses contain more detail about the error in the processing of the request.

Versioning

Our API versions are named after each major release. For example, our latest version is v0-1. Set version via the URL:

Sandbox

For each version of the api there is a sandbox environment with mock responses. Set sandbox via subdomain:

Entities

Refers to any object with which you can interact through this API.

Assets

Refers to any entity that reports metrics records.

All assets

These fields are shared by all assets. Fields marked with * are always present.

Example

Make

Refers to the manufacturer and model of the asset. This defines the abstraction of the collection of particular logics needed for connecting to the asset’s data source.

All makes

These fields are shared by all makes. Fields marked with * are always present.

Example

Integration

Refers to the Integration associated with the make. This entity specifies the protocol and characteristics of the way the connection to the data source is established.

All integrations

These fields are shared by all schemas. Fields marked with * are always present.

Example

Metrics

Refers to the monitored variables and the way they are processed from the asset’s data source. This defines the abstraction of the particular logic needed for ingesting data from the asset’s data source.

All metrics

These fields are shared by all metrics. Fields marked with * are always present.

Example

Process

Refers to how the metric is to be processed and stored by the ingestion logic. The way a metric is to be extracted/calulated from an integration

All processes

These fields are shared by all processes. Fields marked with * are always present.

Example

Job

Refers to an instance of execution of a process, with a defined granularity and time window.

All jobs

These fields are shared by all jobs. Fields marked with * are always present.

Example

Job Schedule

Refers to a schedule for job creation and execution.

All job schedules

These fields are shared by all job schedules. Fields marked with * are always present.

Example

Metric Record

Refers to a data point of a metric.

All metric records

These fields are shared by all metrics. Fields marked with * are always present.

Example

Units and Variables reference