#Api

API

Metricly’s RESTful API allows you read and write data programmatically. This means that you can perform a wide variety of tasks, including adding a new integration, returning a filtered list of Events, removing elements from your account, and more. To view and try out all our API’s visit the Metricly’s Swagger implementation. This web based user interface allows users to view all the APIs, see additional documentation, and test the calls from your browser.

CLI

Metricly strongly encourages you to use the CLI when interacting with our API. The CLI has built-in commands and help information, offering a guided experience when interacting with endpoints. You can create, delete, list, or get several of the features inside Metricly through the CLI without having to worry about structuring the JSON payload exactly right. Installation The GitHub page contains steps to install the Metricly CLI for Mac, Windows, or Linux.

Dashboard API

Create a Dashboard Creating a dashboard through the API requires 3 endpoint actions. 1. POST to /dashboards This creates your dashboard object. Grab its ID after you have completed this step; you need the ID to create widgets. For this example, f1234ee1-a123-123a-1dbd-1d2b34e5f678 is the dashboardId. { "dashboard": { "name": "API Test Board", } } curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ "dashboard": { \ "name": "API Test Board" \ } \ }' 'https://app.

Datasources API

Request Header Header Name Header Value Content-Type application/json Authorization: Basic (Base64 encoded authentication value) POST POST to /datasources Creates a new integration for a tenant account. This method can be used to create one or many integrations and should only be used by an experienced power user. Properties associated to datasources are mapped as strings and cannot be validated, meaning typos are not caught and returned as errors.

Elements API

Request Header Header Name Header Value Content-Type application/json Authorization: Basic (Base64 encoded authentication value) GET GET Element by ID from /elements/{id} This method returns a specified element’s information. Parameters Parameters Required/Optional Description id Required URL (path) parameter. The ID of the element. Get Element IDs from /elements/ids This method returns a list of element IDs for elements seen within a given timeframe.

Events API

The events API allows you to consume events generated by Metricly. You can either grab a list of events generated by Metricly or grab an individual event by its ID. To explore Metricly’s REST API and test some requests, go here. Request Header Header Name Header Value Content-Type application/json POST POST to /ingest/events/{apiId} Creates an external event within Metricly.

Ingest API

This API is used to send Metricly custom data. Two types of custom payloads can be created with this API: Custom elements Custom external event messages Custom Payloads Custom Elements Custom elements can have metrics, tags, attributes, and relationships. POST request: http://api.app.metricly.com/ingest/{apiId} [ { "attributes": [ { "name": "string", "value": "string" } ], "id": "string", "location": "string", "metrics": [ { "id": "string", "name": "string", "sparseDataStrategy": "None", "tags": [ { "name": "string", "value": "string" } ], "type": "string", "unit": "string" } ], "name": "string", "relations": [ { "fqn": "string" } ], "samples": [ { "avg": 0, "cnt": 0, "max": 0, "metricId": "string", "min": 0, "sum": 0, "timestamp": "2018-04-27T01:00:44.

Metrics API

The metrics API allows you access to your element’s metrics. Request Header Header Name Header Value Content-Type application/json Authorization: Basic (Base64 encoded authentication value) GET GET from /metrics Returns a list of metrics that match given parameters. Parameters | Parameters | Required/Optional | Description | |————|——————-|———————————————————————————————————————————————————————————————————————| | startTime | Required | Query parameter. The start of the window of time from which metrics will be returned.

Notifications API

The notifications API allows you to access and create notifications. Request Header Header Name Header Value Content-Type application/json Authorization: Basic (Base64 encoded authentication value) GET GET List of Notifications from /notifications This method will automatically return a list of notifications created for the tenant you are authenticated for. GET a Notification by ID from /notificaitons/{id} This method will return a notification for the given ID.

Packages API

A package is an archive of assets compatible with Metricly, which automatically provision to your account when you install a compatible integration to get ideal configurations for your environment. Packages typically include dashboards, default policies, and analytics configurations. Packages are composed of at least three files: a package.json file, README.md, and at least one policy, analytics configuration, or dashboard. All available packages are available on our community Github. GET GET from /packages Get a list of installed packages