REST API - View a list of links of a CI


GET  /configuration-items/{ci_id}/item-links

  • This method allows a list of links of a specified configuration item (CI) to be obtained.
             example   /configuration-items/18782/item-links
  • To obtain detailed information about a specified CI link: GET  /configuration-items/{parent_ci_id}/item-links/{child_ci_id}. Open url.png See the method.

Notes

     Open url.png  See Service Manager REST API Conventions

  • If successful, an HTTP status code 200 is returned.
    • Only an extract of the most useful fields selected by EasyVista is displayed for each record provided.
    • A URL link (HREF) to each resource is provided so that the complete list of fields for a record can be obtained.

List of parameters / fields

Mandatory parameters

You must use the parameter below in the URL.

Parameter Type Description / Example
ci_id integer CI identifier

Optional parameters

You can use the parameters detailed below in the HTTP request string.

Minimum version Parameter Type Description / Example
max_rows integer Maximum number of records to display.
  • Default value: 100
  • example /configuration-items/18782/item-links?max_rows=5
sort string Sort in ascending or descending order.
  • Syntax: field1[+asc|+desc],field2[+asc|+desc],fieldn[+asc|+desc]
  • example /configuration-items/18782/item-links?sort=child_ci_id+asc
fields string SSelect fields to display.
  • example /configuration-items/18782/item-links?fields=child_ci_id
search string Search/filter the specified fields.   Open url.png See Description of the options.
  • example /configuration-items/18782/item-links?search=employee.e_mail:btalma@itassetservices.com

A search on a Date field is also possible.

  • example /configuration-items/18782/item-links?search=employee.begin_of_contract:last_week
Oxygen 2.1.2 - Build 2018.1.183.0 search

(logical OR operator)

string Search/filter to several values from a same field
  • Syntax: search=field:value1,field:value2
  • example
    • /actions?search=action_type_id:1,action_type_id:20 ==> all actions in which the action type is equal to 1 or 20
    • /actions?search=action_type_id:1,action_type_id:20,done_by_id:18376 ==> only actions attached to the 18376 user and in which the action type is equal to 1 or 20
~

(equivalent to like)

string Include the results which begin with or contain a given character string.
  • Syntax: ~ following by the string to include enclosed in quotation marks.
  • You should use the wildcard character *.
    • < string >* = include what begins with < string >.
    • *< string >* = include what contains < string >.
  • example
    • /configuration-items?search=parent_ci_id~"187*" ==> all links of a CI in which the parent_ci_id field begins with 18782
    • /configuration-items?search=parent_ci_id~"*187*" ==> all links of a CI in which the parent_ci_id field contains 18782
Oxygen 1.7 - Build 2018.1.131.0 !~

(equivalent to not like)

string Exclude the results which begin with or contain a given character string.
  • Syntax: !~ following by the string to exclude enclosed in quotation marks.
  • You should use the wildcard character *.
    • < string >* = exclude what begins with < string >.
    • *< string >* = exclude what contains < string >.
  • example
    • /configuration-items?search=parent_ci_id!~"187*" ==> all links of a CI by excluding those in which the parent_ci_id field begins with 18782
    • /configuration-items?search=parent_ci_id!~"*187*" ==> all links of a CI by excluding those in which the parent_ci_id field contains 18782
Oxygen 1.7 - Build 2018.1.131.0 !

(equivalent to not)

string Exclude all results equal to a given character string.
  • Syntax: ! following by the string to exclude enclosed in quotation marks.
  • example /configuration-items?search=parent_ci_id!"18782" ==> all links of a CI by excluding those in which the parent_ci_id field is equal to 18782
Oxygen 2.1.2 - Build 2018.1.183.0 is_null string Retrieve all results in which the field has no value (field value = null)
  • Syntax: Field name following by "is_null"
  • example
    • /actions?search=end_date_ut:"is_null" ==> all actions in which the end date has no value
    • actions?search=end_date_ut:"is_null",done_by.e_mail:morley@evtry.com&sort=action_id+asc ==> only actions attached to the user morley in which the end date has no value, sorted in ascending identifier
Oxygen 2.1.2 - Build 2018.1.183.0 is_not_null string Retrieve all results in which the field has a value (field value = not null)
  • Syntax: Field name following by "is_not_null"
  • example
    • /actions?search=end_date_ut:"is_not_null" ==> all actions in which the end date has a value
    • actions?search=end_date_ut:"is_not_null",done_by.e_mail:morley@evtry.com&sort=action_id+asc ==> only actions attached to the user morley in which the end date has a value, sorted in ascending identifier
Oxygen 1.7 - Build 2018.1.131.0 formatDate string Specification of the date.   Open url.png See Description of the options
  • example
    • /requests?formatDate=l/M/Y ==> Friday/Nov/2018
    • /requests?formatDate=l jS \of F Y h:i:s A ==> Friday 16th of November 2018 12:00:00 AM

Fields that could be used in optional parameters

  • You can use all the fields from the AM_ASSET table.

HTTP status codes for the method

StatusHeader
Code Error Description
Status200
200 OK (Success) Request processed successfully.
Status401
401 Unauthorized Authentication process for accessing the resource is incorrect: Login/Password incorrect, Invalid session, Incorrect Service Manager account.

example

{
 "error": "Invalid Login / Password"
}

Example

Result for 4 links of a CI (status code 200)

{
   "HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/18782/item-links",
   "record_count": "4",
   "total_record_count": "4",
   "records": [
        {
           "PARENT_HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/18782",
           "HREF": "hhttps://{your_server}/api/v1/{your_account}/configuration-items/48716",
           "BLOCKING": "1",
           "CHILD_CI_ID": "48716",
           "PARENT_CI_ID": "18782",
           "RELATION_TYPE_ID": "129",
           "RELATION_TYPE": {
               "REFERENCE_FR": "Base de données",
               "REFERENCE_ID": "129"
            }
        },
        {
           "PARENT_HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/18782",
           "HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/48718",
           "BLOCKING": "1",
           "CHILD_CI_ID": "48718",
           "PARENT_CI_ID": "18782",
           "RELATION_TYPE_ID": "129",
           "RELATION_TYPE": {
               "REFERENCE_FR": "Base de données",
               "REFERENCE_ID": "129"
            }
        },
        {
           "PARENT_HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/18782",
           "HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/48723",
           "BLOCKING": "1",
           "CHILD_CI_ID": "48723",
           "PARENT_CI_ID": "18782",
           "RELATION_TYPE_ID": "129",
           "RELATION_TYPE": {
               "REFERENCE_FR": "Base de données",
               "REFERENCE_ID": "129"
            }
        },
        {
           "PARENT_HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/18782",
           "HREF": "https://{your_server}/api/v1/{your_account}/configuration-items/49182",
           "BLOCKING": "1",
           "CHILD_CI_ID": "49182",
           "PARENT_CI_ID": "18782",
           "RELATION_TYPE_ID": "129",
           "RELATION_TYPE": {
               "REFERENCE_FR": "Base de données",
               "REFERENCE_ID": "129"
            }
        }
    ]
}


ConventionsAPI

REST API Conventions

Convention Meaning
Orange Parameters used in an HTTP request string which do not correspond to Service Manager database fields.

example   Method View a list of assets


https://{your_server}/api/v1/{your_account}/assets?max_rows=3&fields=asset_tag

Black and Bold Parameters used in the URL of an HTTP request which correspond to Service Manager database fields.

example   Method View an asset


https://{your_server}/api/v1/{your_account}/assets/{asset_id}

Green Parameters used in the body of an HTTP request which represent JSON object names corresponding to Service Manager database fields; they allow the value of a database field to be assigned or modified.

example   Method Close an incident/request

{  "closed": {  "end_date": "11/20/2019 12:12:12",  }  }
Parameters used in the body of an HTTP request which represent JSON object names not corresponding to Service Manager database fields.

example   Method Reopen an incident/request

{  "restarted": {  "comment": "string (required)"  }  }

Tags:
Last modified by Unknown User on 2020/03/30 11:54
Created by Administrator XWiki on 2017/12/21 08:53

Shortcuts

Recent changes
•  Service Manager
•  Service Apps
•  Self Help

Glossary

Powered by XWiki ©, EasyVista 2020