Incidents API
  • 08 Feb 2024
  • 5 Minutes to read
  • Dark
    Light
  • PDF

Incidents API

  • Dark
    Light
  • PDF

Article Summary

Netreo's API system must be enabled to use this API. See How to Enable Netreo API Access

Calls to this API are made using HTTP/HTTPS and are sent as key/value pairs in a GET or POST request.

Security Considerations
Netreo recommends always using POST for API calls if possible. If security is a concern we recommend the use of HTTPS and POST requests.

Resource

The resource accessed by this API is the list of currently "active" incidents in Netreo.

This resource offers the following endpoints:

  • Active Incident List

Resource URL

{your.netreo.ip.or.name}/api

Endpoints

Active Incident List

GET or POST
/incident_api.php
Retrieves the list of active incidents and their related data.

Parameters

The parameters for this endpoint can be included as query string parameters in a GET request, or as request body parameters in a POST request.

pwd
String/Required if authentication is enabled.
The API key set in Netreo’s API Administration. Case-sensitive.

pin
String/Required when using Netreo SaaS-based APIs. Not applicable to on-premise deployments.
The pin number supplied in Netreo’s API Administration.

method
String/Required

  • getincidents retrieves a list of all currently active incidents (i.e. incidents that are not closed).
  • getincidentdetail retrieves complete detailed information about a specific incident along with detailed information on the device that the primary alarm in the incident is related to, if any.

incident_id
String/Required if using getincidentdetail
The unique ID of the incident for which you wish to retrieve details. Only used when using getincidentdetail for the method request above.

Request Examples

Retrieving all active incidents using GET with API authentication enabled

http://38.2.11.62/api/incident_api.php?method_request=getincidents&pwd=PassWord1234

Retrieving detailed information on a specific incident using GET with API authentication enabled

http://38.2.11.62/api/incident_api.php?method_request=getincidentdetail&incident_id=CustomerCorp-1325&pwd=PassWord1234

Response

A successful or unsuccessful call to this API will return a standard JSON object.

Response Examples

Note: The output will be returned as standard JSON without indentation or line breaks. It is formatted here to make the examples easier to read.

Active Incident List

{
    "result":"completed",
    "active_incidents":
     [
        {
            "title":"Application Service for Support",
            "incident_state":"OPEN",
            "incident_id":"sw_omni_9_1-1156",
            "open_time":"2016-07-20T14:55:32"
        },
        {
            "title":"Service EIGRP on Router1",
            "incident_state":"OPEN",
            "incident_id":"CustomerCorp-1325",
            "open_time":"2016-07-22T09:26:33",
            "name":"Router1",
            "device_category":"Core Routers",
            "device_site":"netreo_hq",
            "device_note":"This is an arbitrary note for router1."
        },
        {
            "title":"Service for Device Polling Status on Lync2013_netreo-test_info",
            "incident_state":"OPEN",
            "incident_id":"CustomerCorp-2232",
            "open_time":"2016-08-01T12:16:23",
            "name":"Lync2013_netreo-test_info",
            "device_category":"Windows Servers",
            "device_site":"netreo_hq",
            "device_note":""
        }
     ]
}

Single Incident

 {
      "result":"completed",
      "incident":
       {
           "title":"Service EIGRP on Router1",
           "incident_state":"OPEN",
           "incident_id":"sw_omni_9_1-1325",
           "name":"Router1",
           "device_category":"Core Routers",
           "device_site":"netreo1",
           "related_strategic_groups":
               [
                   "Infrastructure"
               ],
           "device_note":"This is an arbitrary note for router1.",
           "device_documentation":
               [
                 "documentation":
                [
                     {
                        "name":"Router",
                        "value":"1"
                     },
                     {
                        "name":"Where",
                        "value":"Backroom"
                     },
                  ],
               "reference_contact":
                  [
                       {
                          "Contact Address":"8717 Research Dr",
                          "Contact City":"Irvine",
                          "Contact Country":"US",
                          "Contact Email":"info@netreo.com",
                          "Contact Name":"Info",
                          "Contact Number":"949-769-5700",
                          "Contact State":"CA",
                          "Contact Zip":"92708"
                      },
                      {
                          "Contact Address":"8717 Research Dr",
                          "Contact City":"Irvine",
                          "Contact Country":"United States",
                          "Contact Email":"engineering@netreo.com",
                          "Contact Name":"Engineering",
                          "Contact Number":"9497695700",
                          "Contact State":"CA",
                          "Contact Zip":"92708"
                     }
                  ],
             ],
         "primary_alarm_state":"OPEN",
         "incident_open_time":"2016-07-22T09:26:33",
         "acknowledged":0,
         "ack_time":"",
         "ack_user":"",
         "ack_comment":"",
         "alert_type":"Service",
         "detail":
             {
                 "primary_alarm_log":
                     [
                         {
                             "state":"UNKNOWN",
                             "type":"Service",
                             "name":"Router1",
                             "output":"EIGRP Neighbors not available",
                             "time":"2016-07-22T09:26:23"
                         }
                     ],
                 "relatedalarms":
                     [],
                 "incident_log":
                     [
                         {
                             "state":"OPEN",
                             "time":"2016-07-22T09:26:33",
                             "username":"system",
                             "comment":"Initialized state to OPEN"
                          }
                     ]
             }
     }
 }

Response Schema

Active Incident List

OutputTypeDescription
resultstringReturns "completed" if the call was successfully received by Netreo.
Returns "error" if the call encountered an error. A description pair indicating the issue will follow.
active_incidentsarray[object]Array of active incidents.
titlestringThe title of an incident as it appears in Netreo.
incident_statestringThe above incident's current "incident state."
incident_idstringThe unique ID assigned to the above incident.
open_timestringThe date and time the respective incident was opened.
namestringThe name of the managed device associated with the primary alarm for the above incident.
device_categorystringThe category (device group) the above device belongs to.
device_sitestringThe site (device group) the above device belongs to.
device_notestringThe contents of the "Device Note" field from the "Main" device administration page, if any, for the above device.

Single Incident

OutputTypeDescription
resultstringReturns "completed" if the call was successfully received by Netreo.
Returns "error" if the call encountered an error. A description pair indicating the issue will follow.
incidentobjectObject containing all data for this incident.
titlestringThe title of this incident as it appears in Netreo.
incident_statestringThe "incident state" of this incident, at the time of retrieval.
incident_idstringThe unique ID assigned to this incident by Netreo.
namestringThe name of the managed device associated with the primary alarm for this incident.
device_categorystringThe category (device group) this device belongs to.
device_sitestringThe site (device group) this device belongs to.
related_strategic_groupsarray[string]The strategic groups (device group) this device belongs to, if any.
device_notestringThe contents of the "Device Note" field from the "Main" device administration page, if any, for this device.
device_documentationarray[object]Array containing user-created device attributes and reference contacts, if any, for this device.
documentationarray[object]Array containing data, if any, representing the "Device Attributes" section of the Documentation device administration page for this device.
namestringThe user created name for this device attribute.
valuestringThe user assigned value for this device attribute.
reference_contactarray[object]Array containing data, if any, representing the "Reference Contacts" section of the Documentation device administration page for this device.
Contact AddressstringThe respective user entered value for this contact.
Contact CitystringThe respective user entered value for this contact.
Contact CountrystringThe respective user entered value for this contact.
Contact EmailstringThe respective user entered value for this contact.
Contact NamestringThe respective user entered value for this contact.
Contact NumberstringThe respective user entered value for this contact.
Contact StatestringThe respective user entered value for this contact.
Contact ZipstringThe respective user entered value for this contact.
primary_alarm_statestringThe state of the primary alarm of this incident at the time of retrieval.
incident_open_timestringThe date and time this incident was opened.
acknowledgednumberCode indicating if this incident has been acknowledged. 0 indicates incident has not been acknowledged, 1 indicates incident has been acknowledged.
ack_timestringThe date and time this incident was acknowledged.
ack_userstringThe Netreo user who acknowledged this incident.
ack_commentstringThe user-entered comment associated with incident acknowledgement.
alert_typestringThe type of alarm that caused this incident, as listed in Alert Template Administration.
detailstringAdditional data associated with this incident.
primary_alarm_logarray[object]Array of data representing logged state changes for the primary alarm.
statestringThe state of the check that caused this alarm at time (see below).
typestringThe type of Netreo check that caused this alarm.
namestringThe name of the managed device the above check is associated with.
outputstringThe response code or other output returned by the check at time (see below).
timestringThe date and time that this alarm changed to this state.
relatedalarmsarray[object]Array of data representing logged state changes for related alarms (same as primary alarm, above).
incident_logarray[object]Array of data representing Netreo incident log entries for this incident.
statestringThe incident state of the incident at time (see below).
timestringThe date and time of this log entry.
usernamestringThe Netreo username associated with this log entry.
commentstringThe comment associated with this log entry.

Was this article helpful?