How to create incidents using Insomnia

  • KM03632782
  • 07-Apr-2020
  • 07-Apr-2020

Summary

How to create incidents using Insomnia

Question

Sometimes it is necessary to create records in SMAX by external tools such as Postman or Insomnia.

Here a summary of an example about how to use Insomnia to create incidents in SMAX

Answer

1. Make sure an Integration User exists in BO

     Login in https://<SERVER NAME>/bo and create a new Integration User.

2. Create Agent, Endpoint and External System in Dashboard

    From the SMAX dashboard go to Administration > Utilities > Integration.
    NOTE: In the external system, add the user created in the first step

3. From insomnia get the login Token

    From Insomnia, sent a POST request to https://<SERVER NAME>/auth/authentication-endpoint/authenticate/login. Use the Integration user created in the first step.

    {"Login":"IntegrationUser","Password":"Pass of the IntegrationUser"}

    This will return a token.

4. Send a POST request to SMAX

     In Insomnia, add a new header with name "Cookie" and following value:
     LWSSO_COOKIE_KEY=<THE TOKEN FROM ABOVE STEP>

5. Send the POST to the following url: https://<SERVER NAME>/rest/<TENANT ID>/ces

    Using the following JSON:

{
"entities": [
{
"entity_type": "Incident",
"template": "SAW Template name to apply on create (optional)",
"properties": {
"DisplayLabel": "This incident opened from external system.",
"Description": "Created from INSOMNIA by SUPPORT",
"ImpactScope": "MultipleUsers",
"Urgency": "SevereDisruption",
"RegisteredForActualService": "20132",
"Category.DisplayLabel": "Cloud",
"DeviceAffectedByIncident.DisplayLabel": [
"SERV23SD090",
"SERV23SD090"
],
"IncidentCausedByIncident<": [
"20500",
"20505"
],
"IncidentCausedByIncident>": [
"20510",
"20515"
]
},
"Comments": [
{
"Name": "John Smith",
"Body": "Assigned to Central IT.",
"CreatedTime": "April 24, 2014 5:00 PM PST"
}
],
"ext_properties": {
"ExternalSystem": "<THE EXTERNAL SYSTEM NAME CREATED IN STEP 2>",
"Operation": "Create",
"ExternalId": "IM20123",
"ExternalEntityType": "Incident",
"ExternalStatus": "Pending Vendor"
}
}
]
}

NOTE: Everytime a new request is sent, the insomnia Cookies must be deleted from the response panel

For more details:

Details about how to get the token: https://docs.microfocus.com/itom/SMAX:2019.05/ConnectToRESTAPI

Details about RESTAPIs for Case Exchange: https://docs.microfocus.com/itom/SMAX:2019.08/CaseExchange