Post metrics data

POST/projects/{projectId}/entities/{entityId}/metrics/{metricsDefinitionId}/data

Base URL: https://api.tinkermode.com

Post metrics data. The client can use this method to inject time-series data of the metrics.

This method injects the data into the corresponding collection in the Time Series Database instance. Also, it sends an Entity metrics update system event (_entityMetricsUpdate_) to the home of the Entity.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain a user API key of a user with permission to create the entity metrics, a service account token with the same permission, or a project API key with admin permission.

Path parameters

NameTypeRequiredConstraintsDescription
projectIdintegerYesThe unique ID for a specified project.
entityIdstringYesEntity ID (unique within project)
metricsDefinitionIdstringYesMetrics definition ID (unique within entity class)

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
recordsarray<object>Yesread-only (server-generated)Time-series data. Each entry contains the timestamp of the value in RFC3339 format.
Properties of records
PropertyTypeRequiredConstraintsDescription
tagsarray<string>Noread-only (server-generated)An array of tags. The items must correspond to the items in tagNames
timestampstringYesread-only (server-generated)Time in RFC3339 format
valuesarray<number>Yesread-only (server-generated)An array of values. The items must correspond to the items in valueNames
tagNamesarray<string>Noread-only (server-generated)List of unique Identifiers of string tags in metrics.
valueNamesarray<string>Yesread-only (server-generated)List of unique Identifiers of numerical fields in metrics.

Request example

{
  "records": [
    {
      "tags": [
        "5DEF12AA3B",
        "100"
      ],
      "timestamp": "2021-04-10T01:12:22Z",
      "values": [
        89.8,
        77,
        9
      ]
    },
    {
      "tags": [
        "5DEF12AA3B",
        "102"
      ],
      "timestamp": "2021-04-10T01:12:32Z",
      "values": [
        87.2,
        77,
        8.33
      ]
    },
    {
      "tags": [
        "5DEF12AA3B",
        "102"
      ],
      "timestamp": "2021-04-10T01:12:43Z",
      "values": [
        87.5,
        75,
        7.92
      ]
    },
    {
      "tags": [
        "5DEF12AA3B",
        "100"
      ],
      "timestamp": "2021-04-10T01:12:52Z",
      "values": [
        90.3,
        75,
        6.01
      ]
    }
  ],
  "tagNames": [
    "pid",
    "diag"
  ],
  "valueNames": [
    "loi",
    "tem",
    "bri"
  ]
}

Responses

204 The data has been successfully processed. There is no response body.