const fetch = require('node-fetch');

let url = 'https://api.coralogix.com/mgmt/openapi/v1/incidents:list-incident-events-filter-values';

let options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
  body: '{"filter":{"status":["INCIDENT_STATUS_UNSPECIFIED"],"severity":["INCIDENT_SEVERITY_UNSPECIFIED"],"contextualLabels":{"property1":{"contextualLabelValues":["string"]},"property2":{"contextualLabelValues":["string"]}},"name":"string","isMuted":true,"timestamp":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"labels":{"metaLabels":[{"key":"key","value":"value"}],"operator":"FILTER_OPERATOR_OR_OR_UNSPECIFIED"}}}'
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
{
  "filtersValues": {
    "assigneeWithCount": [
      {
        "assignee": "assignee",
        "count": 10
      }
    ],
    "statusWithCount": [
      {
        "status": "INCIDENT_STATUS_UNSPECIFIED",
        "count": 10
      }
    ],
    "stateWithCount": [
      {
        "state": "INCIDENT_STATE_UNSPECIFIED",
        "count": 10
      }
    ],
    "severityWithCount": [
      {
        "severity": "INCIDENT_SEVERITY_UNSPECIFIED",
        "count": 10
      }
    ],
    "contextualLabels": {},
    "metaLabelsWithCount": [
      {
        "metaLabel": {
          "key": "key",
          "value": "value"
        },
        "count": 10
      }
    ],
    "metaLabelsOp": "FILTER_OPERATOR_OR_OR_UNSPECIFIED"
  }
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

A request to get available filter values for incident events

Response

200
application/json

A successful response.

A response containing available filter values for incident events