Documentation forSolarWinds Service Desk

Configuration Items:

Getting a list of all configuration items:

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

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

Getting configuration item details (using configuration item ID number):

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

Create a new configuration item:

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/configuration_items.xml

A list of examples are provided below:

For a custom CI type via XML and JSON, use the command that includes the word "custom", located as the final example in each of the code boxes below.

XML Example:

<configuration_item>

  <name>Configuration item name</name>

  <description>Configuration item description</description>

  <manager>

   <email>email</email>

  </manager>

  <user>

   <email>email</email>

  </user>

  <site>

   <name>Site Name</name>

  </site>

  <department>

    <name>Department Name</name>

  </department>

  <state>Active or Disabled. DEFAULT VALUE Active</state>

  <asset_tag>ASSET TAG WITH NUMBERS AND LETTERS ONLY NO SPACES</asset_tag>

  <type>

    <name>Type Name</name>

  </type>

</configuration_item>

<configuration_item>

<name>ci using api</name>

<type><name>Application</name><custom>0</custom></type>

</configuration_item>

JSON Example:

 

{

  "configuration_item":{

    "name":"My New Configuration Item",

    "description":"My Description",

    "state":"disabled",

    "asset_tag":"myTag1234",

    "type":{"name":"my type"},

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

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

    "site":{"name":"site name"},

    "department":{"name":"department name"}

    }

}

{

"configuration_item": {

"name": "ci using json api",

"type": { "name": "Application", "custom": 0 }

}

}

Updating an existing configuration item:

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/configuration_items/CONFIGURATION_ITEM_ID.xml

XML Example:

<configuration_item>

  <field_to_update>content</field_to_update>

</configuration_item>

JSON Example:

{

  "configuration_item":{

    "state": "active",

    }

}

Deleting a configuration item:

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