Measurement and Measurement Topic Templates

A measurement consists of properties directly associated with the measurement and a number of different measurement topic models. The relationship between a measurement and a measurement topic is a one-to-many relationship respectively.

All the templates can be fetched through the following API end-points:

/measurementTemplates
/measurementTopicTemplates

Fetching measurement templates and topic templates

You can fetch all the measurement templates:

curl
JavaScript
curl -X GET -H "Content-Type: application/json" -H "Congrid-API-Token: YOUR-API-TOKEN" \
  "https://api.congrid.com/v1/measurementTemplates"
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.congrid.com/v1/measurementTemplates',
  headers: 
   { 'congrid-api-token': 'YOUR-API-TOKEN',
     'content-type': 'application/json' } };
     
request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example response with only one template in the system:

{
  "count": 1,
  "pageSize": 100,
  "results": [
    {
      "displayName": "TR 2010",
      "id": "7",
      "measurementTypeId": "TR",
      "modifiedAt": "2017-02-15T07:46:28.834Z",
      "name": "TR 2010",
      "projectId": null,
      "topicIds": [
        "31",
        "32",
        "33",
        "34",
        "35",
        "36",
        "37"
      ]
    }
  ]
}

To fetch all the measurement topic templates use:

curl
JavaScript
curl -X GET -H "Content-Type: application/json" -H "Congrid-API-Token: YOUR-API-TOKEN" \
  "https://api.congrid.com/v1/measurementTopicTemplates"
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.congrid.com/v1/measurementTopicTemplates',
  headers: 
   { 'congrid-api-token': 'YOUR-API-TOKEN',
     'content-type': 'application/json' } };
     
request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Result:

{
  "count": 7,
  "pageSize": 100,
  "results": [
    {
      "id": "37",
      "measurementTemplateId": "7",
      "name": "Dustiness",
      "negativeMultiplier": 1,
      "orderNumber": "6b",
      "positiveMultiplier": 1,
      "projectId": null
    },
    {
      "id": "36",
      "measurementTemplateId": "7",
      "name": "Orderliness and waste management",
      "negativeMultiplier": 1,
      "orderNumber": "6a",
      "positiveMultiplier": 1,
      "projectId": null
    },
    {
      "id": "35",
      "measurementTemplateId": "7",
      "name": "Electricity and lighting",
      "negativeMultiplier": 1,
      "orderNumber": "5",
      "positiveMultiplier": 1,
      "projectId": null
    },
    {
      "id": "34",
      "measurementTemplateId": "7",
      "name": "Safety guards",
      "negativeMultiplier": 1,
      "orderNumber": "4",
      "positiveMultiplier": 1,
      "projectId": null
    },
    {
      "id": "33",
      "measurementTemplateId": "7",
      "name": "Machinery and equipment",
      "negativeMultiplier": 1,
      "orderNumber": "3",
      "positiveMultiplier": 1,
      "projectId": null
    },
    {
      "id": "32",
      "measurementTemplateId": "7",
      "name": "Racks, footbridges and ladders",
      "negativeMultiplier": 1,
      "orderNumber": "2",
      "positiveMultiplier": 1,
      "projectId": null
    },
    {          
      "id": "31",
      "measurementTemplateId": "7",
      "name": "General working",
      "negativeMultiplier": 1,
      "orderNumber": "1",
      "positiveMultiplier": 1,
      "projectId": null
    }
  ]
}

results matching ""

    No results matching ""