Documentation forSolarWinds Service Desk

Incidents

Getting a list of all incidents

curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X GET

https://api.samanage.com/incidents.xml

Getting incident’s details (using incident’s ID number):

curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X GET

https://api.samanage.com/incidents/INCIDENT_ID.xml

Getting incident’s details (using incident’s ID number) including audit archives:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X GET

https://api.samanage.com/incidents/INCIDENT_ID.xml?layout=long&audit_archive=true

Create a new incident:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X POST https://api.samanage.com/incidents.xml

Required fields: <name>,<requester>,<priority>

Optional fields: <description>,<due_at>,<assignee>,<incidents>,<assets>,<problem>,<solutions>,"<category><name>"

XML Example (for creation):

<incident>

  <name>Incident Title</name>

  <priority>Medium</priority>

  <requester><email>demo@samanage.com</email></requester>

  <category><name>Finance</name></category>

  <cc type="array">

    <cc>example@samanage.com</cc>

  </cc>

  <description>Incident description</description>

  <due_at>Dec 11, 2012</due_at>

  <assignee><email>demo@samanage.com</email></assignee>

  <incidents type="array">

    <incident><number>1474</number></incident>

    <incident><number>1475</number></incident>

  </incidents>

  <assets type="array">

    <asset><id>275498</id></asset>

  </assets>

  <problem><number>445</number></problem>

  <solutions type="array">

    <solution><number>34</number></solution>

  </solutions>

  <configuration_items type="array">

    <configuration_item><id>27234</id></configuration_item>

  </configuration_items>

  <custom_fields_values>

    <custom_fields_value>

      <name>field name</name>

      <value>content</value>

    </custom_fields_value>

    <custom_fields_value>

      <name>field name</name>

      <value>content</value>

    </custom_fields_value>

  </custom_fields_values>

</incident>

JSON Example

{

  "incident": {

    "name":"Incident_Title",

    "priority":"PRIORITY",

    "category":{"name":"Incident category"},
    "subcategory":{"name":"Incident subcategory"},

    "requester":{"email":"demo@samanage.com"},

    "description":"Incident description",

    "due_at":"Dec 11,2022",

    "assignee":{"email":"demo@samanage.com"},

    "incidents":{"incident":[{"number":"12345"},{"number":"12345"}]},

    "Problem":[{"number":"123"}],

    "changes":[{"number":"123"}], 

    "Solutions":{"solution":[{"number":"123"}]},

    "assets":[{"id":"123"}],

    "mobiles":[{"id":"123"}],

    "configuration_items":[{"id":"123"}],

    "custom_fields_values":{

      "custom_fields_value":[

        {"name":"field_name","value":"content"},

        {"name":"field_name","value":"content"}]

    }

  }

}

Updating an incident:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X PUT https://api.samanage.com/incidents/INCIDENT_ID.xml

XML Example:

<incident>

  <field_to_update>content</field_to_update>

</incident>

JSON Example:

{

  "incident": {

     "field_to_update": "content"

  }

}

Deleting an incident:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -H 'Accept: application/vnd.samanage.v2.1+xml' -X DELETE https://api.samanage.com/incidents/INCIDENT_ID.xml

Adding tags to an incident on creation:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X POST https://api.samanage.com/incidents.xml

XML Example:

<incident>

   <name>Created via API</name>

   <description>sample1</description>

   <requester>

       <email>jon.doe@samanage.com</email>

   </requester>

   <assignee>

       <email>jon.doe@samanage.com</email>

   </assignee>

   <add_to_tag_list>tag1, tag2, tag3</add_to_tag_list>

</incident>

JSON Example:

{

"incident": {

   "name": "Created via API",

   "description": "sample1",

   "requester": {

     "email": "jon.doe@samanage.com"

   },

   "assignee": {

     "email": "jon.doe@samanage.com"

   },

   "add_to_tag_list": "tag1, tag2, tag3"

}

}