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

Attach Multiple Configuration Items with multiple dependencies to 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/{id}/append_multiple_dependent_assets.xml

XML Example:

<Child_Of>

<selected_ids>

<configuration_items>895106</configuration_items>

<hardwares>949932</hardwares>

<mobiles>15045</mobiles>

</selected_ids>

</Child_Of>

JSON Example:

{      

"Child Of": {

"selected_ids": {

"configuration_items": [

895106

],

"hardwares": [

949932

],

"mobiles": [

15045

]

}

}

}

Delete Configuration Item dependencies:

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/asset_links/delete_asset_link_by_id

XML Example:

<root>

<assetLinkId>79</assetLinkId>

<sourceId>8563</sourceId>

<sourceType>ConfigurationItem</sourceType>

</root>

JSON Example:

{

"assetLinkId": "79",

"sourceId": "8563",

"sourceType": "ConfigurationItem"

}