Creates an metric with given parameters

Params

Param name Description
metric
required

Map containing details of the metric to be created, This map must contain thing_template_key


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:olezAZXGQn9MutnfNerKDQ"  -d '{"metric":{"name":"capacity","abbreviation":"capacity","description":"Metric for thing template Washing Machine","data_type":0,"unit_of_measure":"kilogram","thing_template_key":"af31ae5fb2"}}' https://api.datonis.io/api/v3/metrics

Response (containing details of the metric created)
{
  "metric": {
    "abbreviation": "capacity",
    "created_at": 1448364456,
    "data_type": 0,
    "description": "Metric for thing template Washing Machine",
    "metric_key": "4f9b9764t7",
    "name": "capacity",
    "unit_of_measure": "kilogram",
    "updated_at": 1448364456,
    "treatments": [

    ],
    "thing_template_key": "af31ae5fb2"
  }
}