Documentation forSolarWinds Service Desk

Departments:

Getting a list of all departments:

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

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

Getting department details (using department ID number):

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

Create a new department:

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

Required fields:

<name>

XML Example:

<department>

  <name>Department name</name>

  <description>Description</description>

</department>

JSON Example:

{

  "department":{

    "name":"Department name",

    "description":"description",

  }

}

Updating an existing department:

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/departments/DEPARTMENT_ID.xml

XML Example:

<department>

  <field_to_update>content</field_to_update>

</department>

JSON Example:

{

  "department":{

    "field_to_update":"content",

  }

}

Deleting a department:

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