This documentation supports the 21.3 version of BMC Helix ITSM.To view an earlier version, select the version from the Product version menu.

Example of using the simplified REST API to get person details


The following example demonstrates how you can use the BMC Helix ITSM simplified API to retrieve the following details of a person record:

  • A list of the support groups the person belongs to.
  • Permission details for a logged in user.
  • Person details. 

To retrieve the support group details based on person ID

cURL example

curl -X 'POST' \
 'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/foundation/supportGroups' \
 -H 'accept: application/json' \
 -H 'Content-Type: application/json' \
 -d '{
  "limit": 10,
  "offset": 10,
  "sortBy": [{ "field" : "priority", "order": "desc"}],
  "fields": "['
\''id'\'','\''status'\'']",
  "criteria": {
    "bindingExpression": "AND",
    "conditions": "{\r\n              \"fieldName\": \"status\",\r\n              \"operation\": \"eq\",\r\n              \"fieldValue\": \"27000\"\r\n          },\r\n          {\r\n              \"fieldName\": \"assignee\",\r\n              \"operation\": \"eq\",\r\n              \"fieldValue\": \"Allen Allbrook\"\r\n          }"
  }
}'

Request URL

https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/foundation/supportGroups

Request body

{
 "limit": 10,
 "offset": 10,
 "sortBy": [{ "field" : "priority", "order": "desc"}],
 "fields": "['id','status']",
 "criteria": {
   "bindingExpression": "AND",
   "conditions": "{\r\n              \"fieldName\": \"status\",\r\n              \"operation\": \"eq\",\r\n              \"fieldValue\": \"27000\"\r\n          },\r\n          {\r\n              \"fieldName\": \"assignee\",\r\n              \"operation\": \"eq\",\r\n              \"fieldValue\": \"Allen Allbrook\"\r\n          }"
 }
}

Response body

{
 "loginId": "string",
 "firstName": "string",
 "lastName": "string",
 "fullName": "string",
 "company": "string",
 "permission": [
   "string"
  ],
 "assigneeSupportGroups": [
   {
     "id": "string",
     "name": "string",
     "company": "string",
     "organization": "string",
     "defaultGroup": false,
     "available": false,
     "functionalRole": "string"
   }
  ]
}


To retrieve permission details for a logged in user

cURL example

curl -X 'GET' \
 'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/person/permission?user=Allen&permissiontype=userpermission' \
 -H 'accept: application/json'

Request URL

https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/person/permission?user=Allen&permissiontype=userpermission

Response body

{
 "loginId": "string",
 "firstName": "string",
 "lastName": "string",
 "fullName": "string",
 "company": "string",
 "permission": [
   "string"
  ],
 "assigneeSupportGroups": [
   {
     "id": "string",
     "name": "string",
     "company": "string",
     "organization": "string",
     "defaultGroup": false,
     "available": false,
     "functionalRole": "string"
   }
  ]
}

To retrieve person details based on the person ID

cURL example

curl -X 'GET' \
 'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/person/Allen?fetchSupportGroups=Y' \
 -H 'accept: application/json'

Request URL

https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/person/Allen?fetchSupportGroups=Y

Response body

{
 "loginId": "string",
 "firstName": "string",
 "lastName": "string",
 "fullName": "string",
 "company": "string",
 "permission": [
   "string"
  ],
 "assigneeSupportGroups": [
   {
     "id": "string",
     "name": "string",
     "company": "string",
     "organization": "string",
     "defaultGroup": false,
     "available": false,
     "functionalRole": "string"
   }
  ]
}

The following example demonstrate how to perform the operations by using Postman client.

Before you begin

Make sure that you have a valid authentication token. For more information, see Access-and-authentication-for-the-simplified-REST-API.

To retrieve person details

  1. Open the Postman - REST Client.
  2. Depending on your goal, set the request URL and method as any of the following:

    Goal

    Method

    Sample URL

    To retrieve the support group details based on person ID

    POST

    https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/foundation/supportGroups

    To retrieve permission details for a logged in user

    GET

    https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/person/permission?user=<person ID>&permissiontype=<permission type>

    To retrieve person details based on the person ID

    PATCH

    https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/person/<person ID>?fetchSupportGroups=Y

  3. Click Headers.
  4. Enter the following data as key value pairs in the header:

    Key

    Value

    X-Requested-By

    XMLHttpRequest

    Content-Type

    application/json

  5. Perform the following steps only if you want to retrieve the support group details of a person:
    1. On the Body tab, select raw.
    2. From the list, select JSON.
    3. Enter the JSON.
      For example:

      To retrieve the support group details
      {
       "limit": 10,
       "offset": 10,
       "sortBy": [{ "field" : "priority", "order": "desc"}],
       "fields": "['id','status']",
       "criteria": {
         "bindingExpression": "AND",
         "conditions": "{\r\n              \"fieldName\": \"status\",\r\n              \"operation\": \"eq\",\r\n              \"fieldValue\": \"27000\"\r\n          },\r\n          {\r\n              \"fieldName\": \"assignee\",\r\n              \"operation\": \"eq\",\r\n              \"fieldValue\": \"Allen Allbrook\"\r\n          }"
       }
      }
  6. Click Send.
    The results are displayed on the response panel.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*