curl --request POST \
--url https://api.docusnap365.com/api/v1/assets/query \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"select": [
"id",
"name",
"status"
],
"filter": {
"logic": "And",
"conditions": [
{
"path": "schemaId",
"op": "Eq",
"value": "00000000-0000-0000-0000-000000000000"
},
{
"path": "data.cpuCores",
"op": "Gte",
"value": 4
}
]
},
"sort": [
{
"path": "name",
"desc": false
}
],
"limit": 50,
"expands": [
{
"name": "object_data",
"select": [
"data.cpuCores"
]
}
]
}
'import requests
url = "https://api.docusnap365.com/api/v1/assets/query"
payload = {
"select": ["id", "name", "status"],
"filter": {
"logic": "And",
"conditions": [
{
"path": "schemaId",
"op": "Eq",
"value": "00000000-0000-0000-0000-000000000000"
},
{
"path": "data.cpuCores",
"op": "Gte",
"value": 4
}
]
},
"sort": [
{
"path": "name",
"desc": False
}
],
"limit": 50,
"expands": [
{
"name": "object_data",
"select": ["data.cpuCores"]
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
select: ['id', 'name', 'status'],
filter: {
logic: 'And',
conditions: [
{path: 'schemaId', op: 'Eq', value: '00000000-0000-0000-0000-000000000000'},
{path: 'data.cpuCores', op: 'Gte', value: 4}
]
},
sort: [{path: 'name', desc: false}],
limit: 50,
expands: [{name: 'object_data', select: ['data.cpuCores']}]
})
};
fetch('https://api.docusnap365.com/api/v1/assets/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.docusnap365.com/api/v1/assets/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'select' => [
'id',
'name',
'status'
],
'filter' => [
'logic' => 'And',
'conditions' => [
[
'path' => 'schemaId',
'op' => 'Eq',
'value' => '00000000-0000-0000-0000-000000000000'
],
[
'path' => 'data.cpuCores',
'op' => 'Gte',
'value' => 4
]
]
],
'sort' => [
[
'path' => 'name',
'desc' => false
]
],
'limit' => 50,
'expands' => [
[
'name' => 'object_data',
'select' => [
'data.cpuCores'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.docusnap365.com/api/v1/assets/query"
payload := strings.NewReader("{\n \"select\": [\n \"id\",\n \"name\",\n \"status\"\n ],\n \"filter\": {\n \"logic\": \"And\",\n \"conditions\": [\n {\n \"path\": \"schemaId\",\n \"op\": \"Eq\",\n \"value\": \"00000000-0000-0000-0000-000000000000\"\n },\n {\n \"path\": \"data.cpuCores\",\n \"op\": \"Gte\",\n \"value\": 4\n }\n ]\n },\n \"sort\": [\n {\n \"path\": \"name\",\n \"desc\": false\n }\n ],\n \"limit\": 50,\n \"expands\": [\n {\n \"name\": \"object_data\",\n \"select\": [\n \"data.cpuCores\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.docusnap365.com/api/v1/assets/query")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"select\": [\n \"id\",\n \"name\",\n \"status\"\n ],\n \"filter\": {\n \"logic\": \"And\",\n \"conditions\": [\n {\n \"path\": \"schemaId\",\n \"op\": \"Eq\",\n \"value\": \"00000000-0000-0000-0000-000000000000\"\n },\n {\n \"path\": \"data.cpuCores\",\n \"op\": \"Gte\",\n \"value\": 4\n }\n ]\n },\n \"sort\": [\n {\n \"path\": \"name\",\n \"desc\": false\n }\n ],\n \"limit\": 50,\n \"expands\": [\n {\n \"name\": \"object_data\",\n \"select\": [\n \"data.cpuCores\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docusnap365.com/api/v1/assets/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"select\": [\n \"id\",\n \"name\",\n \"status\"\n ],\n \"filter\": {\n \"logic\": \"And\",\n \"conditions\": [\n {\n \"path\": \"schemaId\",\n \"op\": \"Eq\",\n \"value\": \"00000000-0000-0000-0000-000000000000\"\n },\n {\n \"path\": \"data.cpuCores\",\n \"op\": \"Gte\",\n \"value\": 4\n }\n ]\n },\n \"sort\": [\n {\n \"path\": \"name\",\n \"desc\": false\n }\n ],\n \"limit\": 50,\n \"expands\": [\n {\n \"name\": \"object_data\",\n \"select\": [\n \"data.cpuCores\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}"<string>""<string>""<string>"Query assets
Filters, sorts and selects fields; loads details on request
(expands). Large results come page by page through a cursor.
Queryable fields. Only known fields are accepted; an unknown field
is rejected. Available are id, entityId, schemaId, parentId,
name, objectType, type, iconId, sourceType,
organizationId, locationId, platformId, domainId, version,
status, isManually, createdAt, createdBy,
createdByDisplayName, and the corresponding modified* and
deleted* fields.
data. paths. Paths with the prefix data. address the type’s
data inside an expand. The data type follows the type’s data
definition; a field not defined there is treated as a string. A
filter on schemaId narrows the resolution and speeds it up.
Paging. If an expand returns more rows than its limit, the
response carries a cursor under incompleteExpands for
POST /assets/expand or POST /cursor/continue.
Permission: Read.
curl --request POST \
--url https://api.docusnap365.com/api/v1/assets/query \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"select": [
"id",
"name",
"status"
],
"filter": {
"logic": "And",
"conditions": [
{
"path": "schemaId",
"op": "Eq",
"value": "00000000-0000-0000-0000-000000000000"
},
{
"path": "data.cpuCores",
"op": "Gte",
"value": 4
}
]
},
"sort": [
{
"path": "name",
"desc": false
}
],
"limit": 50,
"expands": [
{
"name": "object_data",
"select": [
"data.cpuCores"
]
}
]
}
'import requests
url = "https://api.docusnap365.com/api/v1/assets/query"
payload = {
"select": ["id", "name", "status"],
"filter": {
"logic": "And",
"conditions": [
{
"path": "schemaId",
"op": "Eq",
"value": "00000000-0000-0000-0000-000000000000"
},
{
"path": "data.cpuCores",
"op": "Gte",
"value": 4
}
]
},
"sort": [
{
"path": "name",
"desc": False
}
],
"limit": 50,
"expands": [
{
"name": "object_data",
"select": ["data.cpuCores"]
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
select: ['id', 'name', 'status'],
filter: {
logic: 'And',
conditions: [
{path: 'schemaId', op: 'Eq', value: '00000000-0000-0000-0000-000000000000'},
{path: 'data.cpuCores', op: 'Gte', value: 4}
]
},
sort: [{path: 'name', desc: false}],
limit: 50,
expands: [{name: 'object_data', select: ['data.cpuCores']}]
})
};
fetch('https://api.docusnap365.com/api/v1/assets/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.docusnap365.com/api/v1/assets/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'select' => [
'id',
'name',
'status'
],
'filter' => [
'logic' => 'And',
'conditions' => [
[
'path' => 'schemaId',
'op' => 'Eq',
'value' => '00000000-0000-0000-0000-000000000000'
],
[
'path' => 'data.cpuCores',
'op' => 'Gte',
'value' => 4
]
]
],
'sort' => [
[
'path' => 'name',
'desc' => false
]
],
'limit' => 50,
'expands' => [
[
'name' => 'object_data',
'select' => [
'data.cpuCores'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.docusnap365.com/api/v1/assets/query"
payload := strings.NewReader("{\n \"select\": [\n \"id\",\n \"name\",\n \"status\"\n ],\n \"filter\": {\n \"logic\": \"And\",\n \"conditions\": [\n {\n \"path\": \"schemaId\",\n \"op\": \"Eq\",\n \"value\": \"00000000-0000-0000-0000-000000000000\"\n },\n {\n \"path\": \"data.cpuCores\",\n \"op\": \"Gte\",\n \"value\": 4\n }\n ]\n },\n \"sort\": [\n {\n \"path\": \"name\",\n \"desc\": false\n }\n ],\n \"limit\": 50,\n \"expands\": [\n {\n \"name\": \"object_data\",\n \"select\": [\n \"data.cpuCores\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.docusnap365.com/api/v1/assets/query")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"select\": [\n \"id\",\n \"name\",\n \"status\"\n ],\n \"filter\": {\n \"logic\": \"And\",\n \"conditions\": [\n {\n \"path\": \"schemaId\",\n \"op\": \"Eq\",\n \"value\": \"00000000-0000-0000-0000-000000000000\"\n },\n {\n \"path\": \"data.cpuCores\",\n \"op\": \"Gte\",\n \"value\": 4\n }\n ]\n },\n \"sort\": [\n {\n \"path\": \"name\",\n \"desc\": false\n }\n ],\n \"limit\": 50,\n \"expands\": [\n {\n \"name\": \"object_data\",\n \"select\": [\n \"data.cpuCores\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docusnap365.com/api/v1/assets/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"select\": [\n \"id\",\n \"name\",\n \"status\"\n ],\n \"filter\": {\n \"logic\": \"And\",\n \"conditions\": [\n {\n \"path\": \"schemaId\",\n \"op\": \"Eq\",\n \"value\": \"00000000-0000-0000-0000-000000000000\"\n },\n {\n \"path\": \"data.cpuCores\",\n \"op\": \"Gte\",\n \"value\": 4\n }\n ]\n },\n \"sort\": [\n {\n \"path\": \"name\",\n \"desc\": false\n }\n ],\n \"limit\": 50,\n \"expands\": [\n {\n \"name\": \"object_data\",\n \"select\": [\n \"data.cpuCores\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}"<string>""<string>""<string>"Authorizations
API key from Docusnap365 (Administration › API keys). Read endpoints require the Read permission, write endpoints require Write.
Body
Query across the assets.
Fields to return. All if omitted.
Conditions joined with And or Or. Groups can be nested.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Cursor of a previous response to load the next page.
Maximum number of rows per page.
Show child attributes
Show child attributes
Response
Result set. If an expand was not delivered completely, incompleteExpands carries one cursor per expand for POST /assets/expand or POST /cursor/continue.
The response is of type object.