Versionen im Vergleich
Version | Alte Version 1 | Neue Version Aktuell |
---|---|---|
Änderungen wurden vorgenommen von | ||
Gespeichert am |
Schlüssel
- Diese Zeile wurde hinzugefügt.
- Diese Zeile wurde entfernt.
- Formatierung wurde geändert.
POST
Codeblock | ||
---|---|---|
| ||
http://{{host}}:{{port}}/storage/rest/api/Repositories('{{repository}}')/Documents?SessionToken={{SessionToken}} |
Beschreibung
Erzeugt ein neues Dokument auf dem CONTENT SERVER mit dem übergebenen JSON-Daten. Rückgabe des kompletten erzeugten Dokuments als JSON Struktur.
Parameter
Name | Wert | Beschreibung |
---|---|---|
Url | ||
SessionToken | {{SessionToken}} | Session Token aus Authenticate request |
Request Header | ||
Content-Type | application/json | |
Response Header | ||
Content-Type | application/json; odata.metadata=minimal; odata.streaming=false; IEEE754Compatible=false; charset=UTF-8 |
Body
Das einzufügende Dokument muss als gültige JSON-Struktur im <body> mitgegeben werden.
Der folgende Beispiel body als JSON erzeugt ein neues Dokument mit den internen Feldern <ARTZAHL> und <Faktura> sowie benutzerdefinierte Informationen <customdata>. Zusätzlich werden die Informationen zu zwei vorher hochgeladenen Binärdateien <_blobs> mit an das Dokument angehängt (siehe Uploads). Die Dateien, die sich im Uploads befinden, werden im Storage abgelegt und bei Erfolg eine neue UUID generiert und im request zurückgegeben.
Elite soft json viewer | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "_subject": "Just a subject", "_doctype": "invoice", "_language": "de", "_externalid": "0050568F572C1ED8B999857F01393628", "_fields": { "ARTZAHL" : { "_active" : true, "_name" : "ARTZAHL", "_datatype" : "UCS2STR", "_value" : "Überweisung", "_confidence" : 100, "_page" : 0, "_zone" : { "_left" : 0, "_top" : 0, "_right" : 1, "_bottom" : 1, "_width" : 1, "_height" : 1 } }, "Faktura" : { "_active" : true, "_name" : "Faktura", "_datatype" : "UCS2STR", "_value" : "0090005188", "_confidence" : 100, "_page" : 0, "_zone" : { "_left" : 0, "_top" : 0, "_right" : 1, "_bottom" : 1, "_width" : 1, "_height" : 1 } } }, "customdata" : { "value" : 1222345.34, "whatever" : { "a" : 1234, "b" : 120, "c" : 300, "d" : 200, "e" : 1 } }, "_blobs" : [ { "_uuid" : "0050568F572C1ED8B999857F01393629.upload", "_ext" : "png", "_mimetype" : "image/png", "_name" : "test", "_bloblink" : "doc://auri/test" }, { "_uuid" : "0050568F572C1ED8B999857F01393630.upload", "_ext" : "pdf", "_mimetype" : "application/pdf", "_name" : "test2", "_bloblink" : "doc://auri/test2" } ] } |
Example Request
Codeblock | ||
---|---|---|
| ||
curl --location --request POST "http://localhost:4680/storage/rest/api/Repositories('REPO')/Documents?SessionToken=8E96F313F3894D5BA1EF54332979B1F7" \ --header "Content-Type: application/json" \ --data "{ \"_externalid\" : \"12345678900987654321123456789012\", \"_subject\": \"About\", \"_doctype\": \"testdoc\", \"_language\": \"de\", \"_fields\": { \"rechnungsnummer\": { \"_name\": \"rechnungsnummer\", \"_datatype": "UCS2STR", \"_value\": 12345, \"_page\": 1, \"_zone\": { \"_left\": 1234, \"_top\": 120, \"_width\": 300, \"_height\": 200 } } }, \"_blobs\" : [ { \"_uuid\" : \"12345678900987654321123456789123.upload\", \"_ext\" : \"txt\", \"_mimetype\" : \"text/plain\", \"_doctype\" : \"text\", \"_name\" : \"test\", \"_bloblink\" : \"doc://auri/test\" } ] }" |
Example Response
Elite soft json viewer | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "@context": "http://localhost:4680/storage/rest/api/$metadata#Documents/$entity", "@editLink": "http://localhost:4680/storage/rest/api/Repositories('REPO')/Documents('55EAFF36CB1B41D9A933F1507F1F78EE')", "@etag": "W/\"5f4b48cf062cda52142a3cae2286e6530b0daaa7\"", "_uuid": "55EAFF36CB1B41D9A933F1507F1F78EE", "_rootuuid": "55EAFF36CB1B41D9A933F1507F1F78EE", "_parentuuid": "", "_storprovid": "23BFCEEA137D4B5A8FA7818785D4E28C", "_state": 0, "_version": 1, "_active": 1, "_deleted": 0, "_createdate": "2019-05-14T12:12:56.512Z", "_changedate": "2019-05-14T12:12:56.512Z", "_docrefid": "", "_subject": "About", "_doctype": "testdoc", "_language": "de", "_externalid": "12345678900987654321123456789012", "_fields": { "rechnungsnummer": { "_active": true, "_name": "rechnungsnummer", "_datatype": "UCS2STR", "_value": "12345", "_confidence": 0, "_page": 1, "_zone": { "_left": 1234, "_top": 120, "_right": 0, "_bottom": 0, "_width": 300, "_height": 200 } } }, "_blobs": [ { "@mediaReadLink": "http://localhost:4680/storage/rest/api/Repositories('REPO')/Documents('55EAFF36CB1B41D9A933F1507F1F78EE')/Blobs('ABC15C035F674ED59387B4236D5B6E82')/$value", "@mediaContentType": "text/plain", "_uuid": "ABC15C035F674ED59387B4236D5B6E82", "_storprovid": "23BFCEEA137D4B5A8FA7818785D4E28C", "_changedate": "2019-05-14T12:12:56.515Z", "_ext": "txt", "_mimetype": "text/plain", "_doctype": "text", "_extblobid": "", "_name": "test", "_blobdata": "", "_bloblink": "doc://auri/test", "_blobsize": 16, "_datasize": 0, "_blobdate": "1899-12-29T23:00:00.000Z", "_encryption": 2 } ] } |
Inhalt |
---|
Untergeordnete Seiten (Anzeige untergeordneter Seiten) | ||||
---|---|---|---|---|
|