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>"Assets abfragen
Filtert, sortiert und wählt Felder aus; lädt auf Wunsch Details mit
(expands). Große Ergebnisse kommen seitenweise über einen
Cursor.
Abfragbare Felder. Nur bekannte Felder sind zulässig; ein
unbekanntes Feld wird abgewiesen. Verfügbar sind id, entityId,
schemaId, parentId, name, objectType, type, iconId,
sourceType, organizationId, locationId, platformId,
domainId, version, status, isManually, createdAt,
createdBy, createdByDisplayName sowie die entsprechenden
modified*- und deleted*-Felder.
data.-Pfade. Pfade mit dem Präfix data. adressieren die Daten
des Typs in einem Expand. Der Datentyp folgt der Datendefinition des
Typs; ein dort nicht definiertes Feld wird als Zeichenkette behandelt.
Ein Filter auf schemaId schränkt die Auflösung ein und beschleunigt
sie.
Seitenweise. Liefert ein Expand mehr Zeilen als sein limit, steht
in der Antwort unter incompleteExpands ein Cursor für
POST /assets/expand oder POST /cursor/continue.
Berechtigung: Lesen.
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>"Autorisierungen
API-Schlüssel aus Docusnap365 (Verwaltung › API-Schlüssel). Lesende Endpunkte verlangen die Berechtigung Lesen, schreibende Schreiben.
Body
Abfrage über die Assets.
Zurückzugebende Felder. Ohne Angabe alle.
Bedingungen, verknüpft mit And oder Or. Gruppen lassen sich schachteln.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Cursor einer vorherigen Antwort, um die nächste Seite zu laden.
Höchste Zeilenzahl je Seite.
Show child attributes
Show child attributes
Antwort
Ergebnismenge. Ist ein Expand nicht vollständig geliefert, enthält incompleteExpands je Expand einen Cursor für POST /assets/expand oder POST /cursor/continue.
The response is of type object.