Skip to main content
node
const fetch = require('node-fetch');

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

let options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
  body: '{"filter":{"applicationName":["string"],"assignee":["string"],"contextualLabels":[{"key":"string","value":{"contextualLabelValues":["string"]}}],"createdAtRange":{"endTime":"2019-08-24T14:15:22Z","startTime":"2019-08-24T14:15:22Z"},"displayLabels":[{"key":"string","value":{"displayLabelValues":["string"]}}],"endTime":"2019-08-24T14:15:22Z","incidentDurationRange":{"endTime":"2019-08-24T14:15:22Z","startTime":"2019-08-24T14:15:22Z"},"isMuted":true,"metaLabels":[{"key":"key","value":"value"}],"metaLabelsOp":"FILTER_OPERATOR_OR_OR_UNSPECIFIED","searchQuery":{"incidentField":"INCIDENTS_FIELDS_UNSPECIFIED","query":"error"},"severity":["INCIDENT_SEVERITY_UNSPECIFIED"],"startTime":"2019-08-24T14:15:22Z","state":["INCIDENT_STATE_UNSPECIFIED"],"status":["INCIDENT_STATUS_UNSPECIFIED"],"subsystemName":["string"]}}'
};

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

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

Request to get available filter values for incidents

filter
object

Filter configuration for incidents

Response

Response containing available filter values for incidents

filtersValues
object
required
I