Skip to content

cmdb.objects#

Work in Progress

cmdb.objects.read#

Fetch a list of objects

Request parameters#

Key JSON data type Required Description
categories Array No Here you can filter by a list or a category, in the form of category constant/s.
"categories": ["C__CATG__MY_CUSTOM_CATEGORY"]
"categories": ["C__CATG__MY_CUSTOM_CATEGORY", "C__CATG__MY_SECOND_CATEGORY"]
filter Array No Filter list of objects; see below for a full list of options
limit Mixed No Maximum amount of objects (as integer), for example, fetch the first thousand of objects: 1000

Combine this limit with an offset (as string), for example, fetch the next thousand of objects: "1000,1000"
order_by String No Order result set by (see filter for more details what each value means):
- "email",
- "first_name",
- "id",
- "last_name",
- "sysid",
- "type",
- "title",
- "type_title"
sort String No Only useful in combination with key order_by; allowed values are either "ASC" (ascending) or "DESC" (descending)

Filter#

Key JSON data type Required Description
ids Array No List of object identifiers (as integers), for example: [1, 2, 3]
type Array No Object type identifier (as integer), for example: 5

Alternatively, object type constant (as string), for example: "C__OBJTYPE__SERVER"
title String No Object title (see attribute Title in category Global), for example: "My little server"
type_title String No Translated name of object type, for example: "Server"
Note: Set a proper language in your request.
sysid String No SYSID (see category Global), for example: "SRV_101010"
first_name String No First name of an object of type Persons (see attribute First name in category Persons → Master Data), for example: "John"
last_name String No Last name of an object of type Persons (see attribute Last name in category Persons → Master Data), for example: "Doe"
email String No Primary e-mail address of an object of type Persons, Person groups or Organization (see attribute E-mail address in categories Persons/Person groups/Organization → Master Data), for example: "john.doe@example.com"
type_group String No Filters by the object type group e.g. Infrastructure or Other:
"C__OBJTYPE_GROUP__INFRASTRUCTURE"
status String No Filter by status of the objects e.g. Normal or Archived:
- C__RECORD_STATUS__BIRTH = Unfinished
- C__RECORD_STATUS__NORMAL = Normal
- C__RECORD_STATUS__ARCHIVED = Archived
- C__RECORD_STATUS__DELETED = Deleted
- C__RECORD_STATUS__TEMPLATE = Template
- C__RECORD_STATUS__MASS_CHANGES_TEMPLATE = Template for mass changes

You can use any combination of filters. Filters are logically associated with AND. A valid combination could be: "Give me all servers which have the same hostname."

Response parameters#

JSON key result contains an array of JSON objects. Each object contains a bunch of information about an i-doit object.

Key JSON data type Description
id String Object identifier (as numeric string)
title String Object title
sysid String SYSID (see category Global)
type String Object type identifier (as numeric string)
created String Date of creation; format: Y-m-d H:i:s
updated String Date of last update; format: Y-m-d H:i:s

Note: This key is optional because not every object has been updated before.
type_title String Translated name of object type
type_group_title String Translated name of object type group
status String Object status:

C__RECORD_STATUS__BIRTH
Status-ID = 1
Title =
Unfinished
C__RECORD_STATUS__NORMAL
Status-ID = 2

Title = Normal
C__RECORD_STATUS__ARCHIVED
Status-ID = 3

Title = Archived
C__RECORD_STATUS__DELETED
Status-ID = 4

Title = Deleted
C__RECORD_STATUS__TEMPLATE
Status-ID = 6

Title = Template
C__RECORD_STATUS__MASS_CHANGES_TEMPLATE
Status-ID = 7

Title = Mass change template
cmdb_status String CMDB status (see category Global; as numeric string)
cmdb_status_title String Translated CMDB status (see category Global)
image String URL to object picture
categories Mixed Optional attributes with values depending on the requested category

Example#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
    "version": "2.0",
    "method": "cmdb.objects.read",
    "params": {
        "filter": {
            "type": "C__OBJTYPE__SERVER",
            "status": "C__RECORD_STATUS__ARCHIVED"
        },
        "limit": "0,10",
        "order_by": "title",
        "sort": "ASC",
        "apikey": "xxx",
        "language": "en"
    },
    "id": 1
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "123",
            "title": "My little server",
            "sysid": "SRV_101010",
            "type": "5",
            "created": "2017-03-07 15:57:48",
            "updated": "2017-05-10 15:40:27",
            "type_title": "Server",
            "type_group_title": "Hardware",
            "status": "3",
            "cmdb_status": "6",
            "cmdb_status_title": "in operation",
            "image": "https://demo.i-doit.com/images/objecttypes/empty.png"
        },
        []
    ]
}