Incident Scenarios

Note: This page has not yet been converted to the new developer portal format. Please use Swagger to test this API.

Incident Scenarios

You can manage your Incident Scenarios library by means of the REST API.

Incident Scenario Data Model

{
  "id": 175926155411458,
  "name": "test1",
  "templateIds": [
    884011643711334,
    884011643711335
  ]
}

incident_scenario_with_exercise_mode.js

{
  "scenarioId": 241896853078031,
  "incidentAction": "Launch",
  "templateIds": [
    241896853080647
  ],
  "incidentNotificationPropertyBag": {
    "enableExerciseMode": true
  },
  "name": "exercise mode test",
  "incidentName": "incident11"
}

GET /incidentScenarios/{organizationID}

Description:

Returns a paged set of incidentScenarios for an organization. The response object will include all incidentScenarios in an organization.

Return type:

IncidentScenarios

Parameters:

NameTypeOptional?Description
organizationIdurlnThe ID of the organization.containing these incidentScenarios.
sortbyqueryyWhether to sort data by id, name, or lastModifiedDate. allowable values=”id, name, lastMlodifiedDate”. Default is id.
directionqueryyWhether to sort data as ASC or DESC, allowableValues=”ASC, DESC”. Default is ASC.
pageNumberqueryyThe page number of incidentScenarios to return. Default is 1.
pageSizequeryyThe page size of inicdenetScenarios to return. Default is 10.

Response:

IncidentScenarios list with paging:

NameTypeOptional?Description
messagestringnOK means success
firstPageUristringyThe link of the first page
nextPageUristringyThe link of the next page
lastPageUristingyThe link of the last page
pageDataPageyMove to the Structure of “page” in response.

The structure of “page” in Response:

NameTypeOptional?Description
pageSizeintnThe size of the current page
startintnThe start index of data
dataintyMove to the Structure of “data” in “page”
totalCountintnThe total size of all data
currentPageNointnThe number of the current page
totalPageCountListnThe total count of pages

The structure of “data” in “page”:

NameTypeOptional?Description
scenarioIdlongnThe ID of the specific scenario
namestringnThe name of the specific scenario
templateIdsListnThe IDs of the template, which related to the specific scenario
templatesListnThe template info (just include ID, name, and status; the value of the status is Active, Draft, or Invalid) which is related to the specific scenario.
NOTE: This is a new parameter as of 2019-11-08.
formVariablesListyThe variables related to the specific scenario, will filter out the variables of the Draft and Invalid templates.

Response Sample:

{
  "message": "OK",
  "firstPageUri": "https://api-qa1.everbridge.net/api/incidentScenarios/888409690210694/?pageNumber=1",
  "lastPageUri": "https://api-qa1.everbridge.net/api/incidentScenarios/888409690210694/?pageNumber=1",
  "page": {
    "pageSize": 10,
    "start": 0,
    "data": [
      {
        "id": 175926155411458,
        "name": "test1",
        "templateIds": [
          884011643711334,
          884011643711335
        ]
      },
      {
        "id": 175926155411457,
        "name": "test2",
        "templateIds": [
          884011643711334,
          884011643711335
        ]
      }
    ],
    "totalCount": 2,
    "currentPageNo": 1,
    "totalPageCount": 1
  }
}

GET /incidentScenarios/{organizationId}/{queryType}

Description:

Return a specific incidentScenario record for the Organization by queryType.

Return type:

IncidentScenarios

Parameters:

NameTypeOptional?Description
organizationIdurlnThe ID of the organization.containing this incidentScenarios
scenarioIdurlnThe ID of the scenario.
queryTypequeryyThe validate value for this parameter is scenarioId or customScenarioId.
If the value of queryType coming from the client is 'customScenarioId', then the value of {scenarioId} is treated as customScenarioId to do the query.
If the value of queryType coming from the client is not provided or is not 'customScenarioId', then the value of {scenarioId} is treated as scenarioId. This logic is used to make sure forward-backward compatibility.
The following are some exampled of the request URLs.
Use the customScenarioId to do the query: " https://://api.everbridge.com/rest/incidentScenarios/8800387990014/1233?queryType=customScenarioId".
Use the scenarioId to do the query: " https://://api.everbridge.com/rest/incidentScenarios/8800387990014/175926155411458?queryType=scenarioId ".
Use the scenarioId to do the query: " https://://api.everbridge.com/rest/incidentScenarios/8800387990014/175926155411458" .
phasequeryyThe phase of the scenario to return.
The validate value for this parameter is New, Update, Close.
The default value is New.

Response:

IncidentScenario with unique variables list

{
  "message": "OK",
  "result": {
    "id": 175926155411458,
    "name": "test1",
    "templateIds": [
      884011643711334,
      884011643711335
    ],
    "formVariables": [
      {
        "variableId": "12765",
        "variableName": "textbox",
        "val": [
          "t1",
          "t2",
          "t3"
        ]
      },
      {
        "variableId": "12767",
        "variableName": "multiple selection",
        "val": [
          "m1",
          "m2",
          "m3"
        ]
      }
    ]
  }
}

POST /incidentScenarios/{organizationId}

Description:

Launch a new incidentScenario.

Return type:

[update]

Parameters:

NameTypeOptional?Description
organizationIdurlnThe ID of the organization.in which to create this incidentScenario.
incidentScenariobodynThe JSON representation of the new incidentScenario.

Request Body:

{
  "incidentAction": "Update/Close/UpdateThenClose/CloseWithNotification/CloseWithoutNotification",
  "incidentName": "scenario1",
  "scenarioId": 175926155411457,
  "customScenario": 123,
  "templateIds": [
    444206992588808,
    444206992588809
  ],
  "formVariables": [
    {
      "variableId": "444206992588802",
      "variableName": "textbox",
      "val": [
        "t1"
      ]
    },
    {
      "variableId": "444206992588803",
      "variableName": "multiple selection",
      "val": [
        "m1",
        "m2",
        "m3"
      ]
    }
  ]
}

Response:

{
  "message": "OK",
  "id": 175926155411502,
  "baseUri": "https://api.everbridge.net/api/incidentScenarios/448605039099942/",
  "instanceUri": "https://api.everbridge.net/api/incidents/448605039099942/175926155411501"
}

PUT /incidentScenarios/{organizationId}/{incidentId}

Description:

Update a launched IncidentScenario.

Parameters:

NameTypeOptional?Description
organizationIdurlnThe ID of the organization.in which to create this incidentScenario.
incidentIdurlnThe incident ID of the updated scenario.
incidentScenariobodynThe JSON representation of the updated incidentScenario.

Request Body:

{
  "incidentAction": "Update/Close/UpdateThenClose/CloseWithNotification/CloseWithoutNotification",
  "incidentName": "scenario1",
  "scenarioId": 175926155411457,
  "customScenario": 123,
  "templateIds": [
    444206992588808,
    444206992588809
  ],
  "formVariables": [
    {
      "variableId": "444206992588802",
      "variableName": "textbox",
      "val": [
        "t1"
      ]
    },
    {
      "variableId": "444206992588803",
      "variableName": "multiple selection",
      "val": [
        "m1",
        "m2",
        "m3"
      ]
    }
  ]
}

Response:

{
  "message": "OK",
  "id": 175926155411502,
  "baseUri": "https://api.everbridge.net/api/incidentScenarios/448605039099942/",
  "instanceUri": "https://api.everbridge.net/api/incidents/448605039099942/175926155411501"
}