Inspection and Inspection Topic Templates

Similarly as was the case with measurement, each inspection in Congrid consists of properties directly associated with the inspection and a number of different inspection topic models.

Again the relationship between an inspection and an inspection topic is a one-to-many relationship respectively.

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

/inspectionTemplates
/inspectionTopicTemplates

Fetching inspection templates and topic templates

You can fetch all the inspection templates:

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

var options = { method: 'GET',
  url: 'https://api.congrid.com/v1/inspectionTemplates',
  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": [
    {
      "availableForAll": true,
      "availableForCompany": true,
      "createdAt": "2016-12-15T07:42:36.189602Z",
      "id": "93607",
      "modifiedAt": "2016-12-15T07:46:55.868242Z",
      "name": "Inspection template 1",
      "projectId": "PilvPWN3hZoNq4UOXVg6FFklXBJRTVzQ",
      "topicIds": [ "8888" ]            
    }
  ]
}

To fetch all the inspection 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/inspectionTopicTemplates"
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.congrid.com/v1/inspectionTopicTemplates',
  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": 1,
  "pageSize": 100,
  "results": [
    {
      "id": "8888",
      "orderNumber": "1",
      "name" : "Inspection topic 1"
    }
  ]
}

results matching ""

    No results matching ""