Ein Asset anlegen oder aktualisieren
curl --request POST \
--url https://api.docusnap365.com/api/v1/asset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11",
"object": {
"name": "Server01",
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11"
}
}
'import requests
url = "https://api.docusnap365.com/api/v1/asset"
payload = {
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11",
"object": {
"name": "Server01",
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11"
}
}
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({
schemaId: '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11',
object: {name: 'Server01', schemaId: '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11'}
})
};
fetch('https://api.docusnap365.com/api/v1/asset', 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/asset",
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([
'schemaId' => '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11',
'object' => [
'name' => 'Server01',
'schemaId' => '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11'
]
]),
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/asset"
payload := strings.NewReader("{\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\",\n \"object\": {\n \"name\": \"Server01\",\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\"\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/asset")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\",\n \"object\": {\n \"name\": \"Server01\",\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docusnap365.com/api/v1/asset")
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 \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\",\n \"object\": {\n \"name\": \"Server01\",\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idPair": {
"fakeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dbId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previousSchemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idMatchResponse": {},
"isCreate": true,
"matchedObjectInRecycleBin": true,
"errorMessage": "<string>",
"error": {
"code": "<string>",
"path": "<string>",
"data": {}
},
"isSuccess": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idPair": {
"fakeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dbId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previousSchemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idMatchResponse": {},
"isCreate": true,
"matchedObjectInRecycleBin": true,
"errorMessage": "<string>",
"error": {
"code": "<string>",
"path": "<string>",
"data": {}
},
"isSuccess": true
}{
"type": "urn:ds365:error:required-field-missing",
"title": "Required field missing",
"status": 400,
"detail": "Bundle.Object.Name is required",
"instance": "/api/v1/asset",
"errorCode": "REQUIRED_FIELD_MISSING",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"path": "object.name"
}
]
}{
"type": "urn:ds365:error:api-key-missing",
"title": "API key missing",
"status": 401,
"detail": "The request has no X-API-Key header. Create an API key in the web app and send it in that header.",
"instance": "/api/v1/assets",
"errorCode": "API_KEY_MISSING",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "API_KEY_MISSING"
}
]
}{
"type": "urn:ds365:error:forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Missing required scopes: api_write",
"instance": "/api/v1/asset",
"errorCode": "FORBIDDEN",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "FORBIDDEN",
"data": {
"missingScopes": [
"api_write"
]
}
}
]
}{
"type": "urn:ds365:error:rest-request-quota-exceeded",
"title": "Request quota exceeded",
"status": 429,
"detail": "The request quota of 10000 requests per period is exhausted until 2026-12-01T00:00:00.0000000+00:00.",
"instance": "/api/v1/assets",
"errorCode": "REST_REQUEST_QUOTA_EXCEEDED",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "REST_REQUEST_QUOTA_EXCEEDED",
"data": {
"requestsLimit": 10000,
"requestsUsed": 10000,
"quotaResetAt": "2026-12-01T00:00:00+00:00"
}
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errorCode": "<string>",
"traceId": "<string>",
"errors": [
{
"code": "<string>",
"path": "<string>",
"data": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errorCode": "<string>",
"traceId": "<string>",
"errors": [
{
"code": "<string>",
"path": "<string>",
"data": {}
}
]
}Assets
Ein Asset anlegen oder aktualisieren
Schreibt ein Asset. Der Dienst leitet den Anfragekörper an den Ingest-Dienst weiter und gibt dessen Antwort zurück: 201, wenn das Asset angelegt wurde, 200, wenn es aktualisiert wurde.
Mit objectData entscheidet der Ingest-Dienst über die Identitätszuordnung, ob das Asset schon besteht. Ohne objectData ist object.id Pflicht, und das Asset wird aktualisiert.
Braucht das Recht api_write (Lesen und Schreiben). Lehnt der Ingest-Dienst das Asset ab, antwortet die API mit application/problem+json; der errorCode nennt den Grund, path das Feld der Anfrage, soweit bekannt, und data weitere Werte.
POST
/
asset
Ein Asset anlegen oder aktualisieren
curl --request POST \
--url https://api.docusnap365.com/api/v1/asset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11",
"object": {
"name": "Server01",
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11"
}
}
'import requests
url = "https://api.docusnap365.com/api/v1/asset"
payload = {
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11",
"object": {
"name": "Server01",
"schemaId": "9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11"
}
}
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({
schemaId: '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11',
object: {name: 'Server01', schemaId: '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11'}
})
};
fetch('https://api.docusnap365.com/api/v1/asset', 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/asset",
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([
'schemaId' => '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11',
'object' => [
'name' => 'Server01',
'schemaId' => '9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11'
]
]),
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/asset"
payload := strings.NewReader("{\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\",\n \"object\": {\n \"name\": \"Server01\",\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\"\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/asset")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\",\n \"object\": {\n \"name\": \"Server01\",\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docusnap365.com/api/v1/asset")
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 \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\",\n \"object\": {\n \"name\": \"Server01\",\n \"schemaId\": \"9b2f6a52-1c0e-4c5a-8d55-5f0f6a3f7a11\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idPair": {
"fakeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dbId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previousSchemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idMatchResponse": {},
"isCreate": true,
"matchedObjectInRecycleBin": true,
"errorMessage": "<string>",
"error": {
"code": "<string>",
"path": "<string>",
"data": {}
},
"isSuccess": true
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idPair": {
"fakeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dbId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previousSchemaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idMatchResponse": {},
"isCreate": true,
"matchedObjectInRecycleBin": true,
"errorMessage": "<string>",
"error": {
"code": "<string>",
"path": "<string>",
"data": {}
},
"isSuccess": true
}{
"type": "urn:ds365:error:required-field-missing",
"title": "Required field missing",
"status": 400,
"detail": "Bundle.Object.Name is required",
"instance": "/api/v1/asset",
"errorCode": "REQUIRED_FIELD_MISSING",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"path": "object.name"
}
]
}{
"type": "urn:ds365:error:api-key-missing",
"title": "API key missing",
"status": 401,
"detail": "The request has no X-API-Key header. Create an API key in the web app and send it in that header.",
"instance": "/api/v1/assets",
"errorCode": "API_KEY_MISSING",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "API_KEY_MISSING"
}
]
}{
"type": "urn:ds365:error:forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Missing required scopes: api_write",
"instance": "/api/v1/asset",
"errorCode": "FORBIDDEN",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "FORBIDDEN",
"data": {
"missingScopes": [
"api_write"
]
}
}
]
}{
"type": "urn:ds365:error:rest-request-quota-exceeded",
"title": "Request quota exceeded",
"status": 429,
"detail": "The request quota of 10000 requests per period is exhausted until 2026-12-01T00:00:00.0000000+00:00.",
"instance": "/api/v1/assets",
"errorCode": "REST_REQUEST_QUOTA_EXCEEDED",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"errors": [
{
"code": "REST_REQUEST_QUOTA_EXCEEDED",
"data": {
"requestsLimit": 10000,
"requestsUsed": 10000,
"quotaResetAt": "2026-12-01T00:00:00+00:00"
}
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errorCode": "<string>",
"traceId": "<string>",
"errors": [
{
"code": "<string>",
"path": "<string>",
"data": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errorCode": "<string>",
"traceId": "<string>",
"errors": [
{
"code": "<string>",
"path": "<string>",
"data": {}
}
]
}Autorisierungen
Body
application/json
Antwort
Das Asset wurde aktualisiert.
Die Antwort des Ingest-Dienstes zu einem Asset. Eigenschaften ohne Wert fehlen.