Documentation forSolarWinds Service Desk

Service Requests

Create a new service request [xml]:

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/catalog_items/CATALOG_ITEM_ID/service_requests.xml

XML Example:

<incident>

  <requester_name>REQUESTER_EMAIL_ADDRESS</requester_name>

  <due_at>DATE</due_at>

  <priority>PRIORITY</priority>

  <site_id>SITE_ID</site_id>

  <department_id>DEPT_ID</department_id>

  <request_variables_attributes type=”array”>

    <request_variables_attribute>

      <name>VARIABLE_NAME</name>

      <value>VARIABLE_VALUE</value>

   </request_variables_attribute>

   <request_variables_attribute>

      <name>VARIABLE_NAME</name>

      <value>VARIABLE_VALUE</value>

   </request_variables_attribute>

</request_variables_attributes>

</incident>

To create a service with a variable of type user, use the tag <user_value> instead of <value>.

XML Example:

<request_variables_attributes type=”array”>

  <request_variables_attribute>

    <name>VARIABLE_NAME</name>

    <user_value>

<email>abc@example.com</email>

    </user_value>

  </request_variables_attribute>

</request_variables_attributes>

Create a new service request [JSON]:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_JSON' -H 'Accept: application/vnd.samanage.v2.1+json' -H 'Content-Type: application/json' -X POST https://api.samanage.com/catalog_items/CATALOG_ITEM_ID/service_requests.json

JSON Example:

{

  "incident": {

    "requester_name": "REQUESTER_EMAIL_ADDRESS",

    "due_at": "DATE",

    "priority": "PRIORITY",

    "site_id": "SITE_ID",

    "department_id": "DEPT_ID",

    "request_variables_attributes": [

      {

        "name": "VARIABLE_NAME",

        "value": "VARIABLE_VALUE"

      },

      {

        "name": "VARIABLE_NAME",

        "value": "VARIABLE_VALUE"

      }

    ]

  }

}

Specific variable type examples

USER

To create a service with a variable of type user, use the tag “user_value" instead of “value".

JSON Example:

"request_variables_attributes": [

  {

    "name": "VARIABLE_NAME",

    "user_value": { "email": "abc@example.com" }

  }

]

PRIORITY

Use the associated priority number in the XML/JSON data.

  1. "-1": None

  2. "4": Low

  3. "3": Medium

  4. "2": High

  5. "1": Critical

DEPENDENT DROPDOWN

When using a Dependent Dropdown you will only need to enter the variable that is selected out of this dependent dropdown. The Dependent Dropdown itself should not be in the body.

MULTI-PICKLIST

To create a service with a variable of type multi-picklist, use “#dlmtr#” to separate between values.

JSON Example:

"request_variables_attributes": [

  {

    "name": "VARIABLE_NAME",

    "value": "option1#dlmtr#option2"

  }

]

ATTACHMENT

To create a service with a variable of type attachment, it is necessary to use content type ‘multipart/form-data’ instead of providing json or xml. For example:

curl -H 'X-Samanage-Authorization: Bearer TOKEN'\

-F 'incident[requester_name]=REQUESTER_EMAIL' \

-F 'incident[request_variables_attributes][0][name]=VARIABLE_NAME' \

-F 'incident[request_variables_attributes][0][kind]=attachment' \

-F 'incident[request_variables_attributes][0][upload]=@/PATH/TO/FILE' \

-H 'Accept: application/vnd.samanage.v2.1+json' \

-H 'Content-Type: multipart/form-data' \

-X POST https://api.samanage.com/catalog_items/CATALOG_ITEM_ID/service_requests.json