Documentation forSolarWinds Service Desk

Users:

Getting a list of all users:

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

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

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

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

Creating a new user:

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

Required fields:

<email>

XML Example:

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

  <disabled>false</disabled>
  <name>Demo User</name>
  <phone>123456789</phone>

  <mobile_phone>123456789</mobile_phone>
  <role><name>Administrator</name></role>

  <site><name>Site name</name></site>

  <department><name>Department name</name></department>

  <reports_to><email>Supervisor’s Email</email></reports_to>

  <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>

  <avatar_url>https://s3.amazonaws.com/samanage…</avatar_url>
</user>

JSON Example:

{

    "user": {

    "email": "demo@samanage.com",

        "disabled": false,

        "name": "Demo User",

    "phone": "123456789",

    "mobile_phone": "123456789",

    "role": {"name": "Administrator"},

    "site": {"name": "Site Name"},

    "department": {"name": "Department Name"},

    "reports_to": {"email": "Supervisor’s Email"},

"custom_fields_values":{

"custom_fields_value":[

{"name": "Custom Field Name 1", "value": "Value 1"},

{"name": "Custom Field Name 2", "value": "Value 2"},

{"name": "Custom Field Name 3", "value": "Value 3"}]}

}

}

Updating an existing user:

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/users/USER_ID.xml

XML Example:

<user>

  <field_to_update>content</field_to_update>

</user>

JSON Example:

{

"user": {

"field_to_update": "content",

}

}

Deleting a user:

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