Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We will need the base64 version of the token for the rest of the activity.

Image Modified

Figure 1.1 - Manage Administrators

Select everything (including the = at the end)

...

Code Block
languagepy
[
    {
        "id": 1,
        "name": "All Windows",
        "favorite": true,
        "group": 1,
        "version": 1
    },
    {
        "id": 2,
        "name": "Mac OS X 10.7-10.11",
        "favorite": false,
        "group": 1,
        "version": 5
    },
...
    {
        "id": 103,
        "name": "All Computers to retire",
        "favorite": false,
        "group": 3,
        "version": 2
    }
]
KeyValueDescription
id
number
The unique number for the query. To be used as reference
name
txt
The name given to the query
favorite
true/false
The state if the query has a check next to it or not to show in the sidebar of admin
group
number
The group number given. built-in queries – for example – would be in the "Sample Queries" group, which is group 1. If the user made new groups
version
number
The version for the query. How many times has the query been altered and saved, starting with 1


GET the Query Information

...

Code Block
languagepy
{
    "criteria": {
        "expressions": [
            {
                "column": "type",
                "component": "OperatingSystem",
                "operator": "=",
                "qualifier": "WIN"
            }
        ],
        "logic": "all"
    },
    "favorite": true,
    "fields": [
        {
            "column": "device_name",
            "component": "Client"
        },
        {
            "column": "filewave_client_name",
            "component": "Client"
        },
        {
            "column": "name",
            "component": "OperatingSystem"
        },
        {
            "column": "version",
            "component": "OperatingSystem"
        },
        {
            "column": "build",
            "component": "OperatingSystem"
        },
        {
            "column": "edition",
            "component": "OperatingSystem"
        }
    ],
    "main_component": "Client",
    "name": "All Windows",
    "id": 1,
    "version": 1,
    "group": 1
}
KeyValueDescription
criteria
array

Where all the criteria for the query is saved


Expressions - Repeated for each Criteria

KeyValueDescription
column
(too many to list. See "Show all component ")
The specific component to filter by (Figure 1.2 #1)
component
(too many to list. See "Show all component ")
The component group where the item was found (Figure 1.2 #2)
operator
(too many to list. See "Show all Fields")
(Figure 1.2 #3)
qualifier
(too many to list. See "Show all component")
(Figure 1.2 #4)

Logic

KeyValueDescription
logic
all / one / none
(Figure 1.2 #5)
favorite
true/false
The state if the query has a check next to it or not to show in the sidebar of admin
fields
array
Where how the results are shown

Repeated for each field shown

KeyValueDescription
column
(too many to list. See "Show all component")
The specific component to show
component
(too many to list. See "Show all component")
The component group where the item was found
main_component

(Figure 1.2 #6)
name
txt
The name given to the query
id
number
The unique number for the query. To be used as reference
version
number
The version for the query. How many times has the query been altered and saved, starting with 1
group
number
The group number given. built-in queries – for example – would be in the "Sample Queries" group, which is group 1. If the user made new groups

Image Modified

Figure 1.2 - Query Builder Criteria



GET the Query Results

Code Block
titleGet Query Results
curl -s -k -H "Authorization: e2FjYzRkYmQzLTI3ZjYtNDEyMi1iMGVhLTI1YmY0OGNmYWM0NX0=" https://myserver.company.org:20445/inv/api/v1/query_result/1 | python -mjson.tool
Code Block
languagepy
{
    "total_results": 13,
    "filter_results": 13,
    "offset": 0,
    "values": [
        [
            "FW-BLUE-02",
            "FW-Blue-02",
            "Windows 10.0",
            "10.0.0",
            "10240",
            "Microsoft Windows 10 Home"
        ],
        [
            "LAPTOP-C6LLFGH6",
            "FH-History3",
            "Windows 10.0",
            "10.0.0",
            "14393",
            "Microsoft Windows 10 Home"
        ],
...
    ],
    "version": 3
}
KeyValueDescription
total_results
number
Total count of results
filter_results
number

offset
number

values
arrayThe results. Repeated for each result. Items depends on what your specified in the fields
version
number
The version for the query. How many times has the query been altered and saved, starting with 1


Useful Tools

Converting to/from base64

...

Below are the options for use with it.

URLs

URLUseOptions
Inventory
query
Show all queries
GET POST
query/#

Show information on a single query

Where # is the query ID

GET PUT DELETE
query_group/
Show all query group
GET POST
query_group/#

Detail information on a single group

Where # is the group ID

GET PUT DELETE
query_result/#

Show the results of one query

Where # is the query ID

GET POST
query_count

POST
component
Show all component options on your instance
GET
field_type
Show all fields on your instance
GET
License
license_definition
Show all query
GET
license_definition/#

Show information on a single license

Where # is the license ID

GET
Custom Fields
custom_field/
Show all custom fields
custom_field/get_association

POST
custom_field/set_association

POST
custom_field/upload

POST
custom_field/usages/<Field_Name>

Where <Field_Name> is the Internal Name (E.G "battery_cycle_count")
GET
custom_field/values/

POST
custom_field/edit/

POST


Examples

Using a browser extension

...

Code Block
curl -s -k -H "Authorization: e2FjYzRkYmQzLTI3ZjYtNDEyMi1iMGVhLTI1YmY0OGNmYWM0NX0=" -X DELETE https://myserver.company.org:20445/inv/api/v1/query/<id#>
Info

For more curl help, see: Using the RESTful API to limit, sort, and offset values returned


Using PHP

Saved as a php file (like inv.php), update the url and auth code, then place the file on a web server where PHP has been enabled. This creates a webpage that is a view only version of your inventory. People can go to the URL for the query and hit refresh as many times as they like, always seeing the latest information in inventory All without having to hassle IT for the latest data.

...