[POST] /objects

[POST] /objects

/api/dms/objects

Description

General:

To insert one or more DMS objects, send the request with metadata and content as multipart request body. The parent object to insert into is specified with the field system:parentId.
To update one or more DMS objects, add the field system:objectId with the osid of the DMS object to be updated to the properties of each object.
If an object has content attached, add a contentStreams section to its json. The cid property of a contentStreams json object must then be equal to a multipart section of the HTTP request.
The response is a JSON structure containing all created and updated objects. Insertion and Updates can be mixed if some objects have a system:objectId and some do not.
If only metadata should be inserted without content it is also possible to send a normal POST request with application/json and no multipart request.
Since Version 4.1.0 it is possible to send enaio server job options within a insert / update request for each dms object to process. With this enaio server job options it is possible to set a object ready for archiving as a example.
Since Version 5.3.0 it is possible to send the internal name as objectTypeId within this endpoint. This make the usage of the endpoint easier within multiple installations.
Since Version 6.5.4 the endpoint return only objectId and objectTypeId in case a DMS object is no longer visible (due to e.g. clauses) after a insert/update.

User tray (min Version 3.1.0):

To insert one or more DMS objects to the user tray use for system:parentId the value system:tray.
The user tray accepts also typeless objects which can be created if the value of system:objectTypeId is set to system:typeless. In this case a main type value must be set with the property system:mainType. The value depends on the wanted dms object type:

  • system:mainType = 1: Gray image object type

  • system:mainType = 2: Black/White image object type

  • system:mainType = 3: Color image object type

  • system:mainType = 4: Windows Document object type

Moving objects to a new parent (since Version 3.1.0):

To move a DMS object from one location to another this endpoint next to the Multipart/POST-Endpoint can be used. The example "Request Example Moving... to a new location" show which system properties must be set. In system:parentId the object id of the new parent (folder or register) must be inserted. Depending if the currently direct parent is a folder or a register it's object id must be inserted into system:FOLDERID or system:REGISTERID like shown in the example below.

Moving objects from the user tray to a fix location (since Version 3.1.0):

Objects from the user tray can be moved to a fix location by only settings the system:parentId to the object id of the new parent (folder or register). It is not possible to move typeless objects to a fix location. This kind of objects must be updated to a fix type in before. Updating a typeless object to a fixed type and moving it to a new location can be done in one request if system:parentId and system:objectTypeId are combined.

Updating typeless objects to typed objects (since Version 3.1.0):

The update endpoint can be used to set the type for typeless objects. For this the system property system:objectTypeId must be set to the id of the new object type. Also all required fields must be set within the update request. It is also possible to move the object in the same request to a fix location. In this case the typeless object is first updated to the new type and afterwards moved to the new location.

Updating retention date of document objects (since Version 3.1.0):

The retention date can be set / adjusted on document objects by adding the property system:OBJECT_RETENTION_PLANNED with a ISO date without time part (e.g. 2020-12-13).

Creating reference documents ("green arrow") at a location (since 5.0.0):

To create a reference document at a location the following system properties must be send to the DMS service: system:OBJECT_FOREIGNID with the source object Id and system:OBJECT_SYSTEMID with the value "0".

Adding an additional location to an existing object (since 5.1.0):

To add another location to an already existing document object, specify the new parent with system:parentId and additional in the options part specify that it is a link location ("LINKDOCUMENT": 1). See example below.

Moving and Updating a object in one call (since Version 6.5.1):

Moving and updating a DMS object in one call can be made if index data fields, which should be updated, are included in the JSON next to the mandatory informations for moving the DMS object (see section for moving).

It is not possible to move a document that is located in multiple locations and simultaneously update its index data. When a document has multiple locations, either the REGISTERID or the FOLDERID must be provided to specify which location the document is to be moved from. In this case, due to the presence of multiple locations, it is not feasible to update the index data at the same time as the move operation. If the document has only a single location, there is no need to specify either the REGISTERID or FOLDERID, and in this case, both the move and the update of the index data can be performed simultaneously.

Request
Method

POST

Request optional Query Parameter

  • minimalResponse (Boolean): The response contains for each object only the two properties "system:objectId", "system:objectTypeId". This speeds up the endpoint by 30%

Request Header

Content-Type: multipart/form-data
Content-Type: application/json (since Version 3.2.0)

Response
Format

JSON

Response
Status codes

Success: HTTP 200
In case one or more inserts/updates/move failed: HTTP 422

Minimum Version

3.0.0

Changelog

  • 3.1.0: Insert into UserTray, Moving objects to a new location, typless object to typed objects, setting retention time.

  • 3.2.0: New Query Parameter "minimalResponse", POST application/json endpoint added in parallel. The "data" section of the multipart must now be application/json and no longer text/plain (string).

  • 4.0.2: Server-Option REPLACETABLEFIELDS=1 will be default now like in the enaio AppConnector. This result in replacing all old table fields on update with the new send one instead of appending them.

  • 5.0.0: enaio server job options are available.

  • 5.3.0: Internal name is accepted within the system property "system:objectTypeId".

  • 6.5.4: The endpoint return only objectId and objectTypeId in case a DMS object is no longer visible (due to e.g. clauses) after a insert/update.

Request
Example
Multipart

The request example represents the complete multipart for the import of an e-mail. In addition to the metadata and the e-mail content, a text rendition is imported.

POST /api/dms/objects HTTP/1.1 Accept: application/json, application/*+json Content-Type: multipart/form-data;boundary=Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH User-Agent: Java/1.8.0_60 Connection: keep-alive Content-Length: 83258 Host: 127.0.0.1:7400 --Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH Content-Disposition: form-data; name="data" Content-Type: application/json;charset=UTF-8 { "objects": [{ "properties": { "system:objectTypeId": { "value": "262208" }, "system:parentId": { "value": "7308" }, "from": { "value": "Garco Meissler <garco@example.de>" }, "to": { "value": "Dudreas Annkel <dudreas@example.de>" }, "cc": { "value": "Kruedeas Anger <kruedeas@example.de>" }, "subject": { "value": "Bewerbungsunterlagen" } }, "contentStreams": [{ "mimeType": "message/rfc822", "fileName": "upload.eml", "cid": "cid_63apple" }] }] } --Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH Content-Disposition: form-data; name="cid_63apple"; filename="upload.eml" Content-ID: cid_63apple Content-Type: message/rfc822 From: Garco Meissler <garco@example.de> To: Dudreas Annkel <dudreas@example.de> Cc: Kruedeas Anger <kruedeas@example.de> Message-ID: <12716821.1.1500391295036.JavaMail.meissler@APGMEISSLER> Subject: =?UTF-8?Q?Bewerbungsunterlagen?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_16468615.1500391295024" ------=_Part_0_16468615.1500391295024 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy ei= rmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam volu= ptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita k= asd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore= ... en, no sea takimata sanctus est Lore ------=_Part_0_16468615.1500391295024--

Request
Example
JSON



{ "objects": [{ "properties": { "system:objectTypeId": { "value": "262208" }, "system:parentId": { "value": "7308" }, "from": { "value": "Garco Meissler <garco@example.de>" }, "to": { "value": "Dudreas Annkel <dudreas@example.de>" }, "cc": { "value": "Kruedeas Anger <kruedeas@example.de>" }, "subject": { "value": "Bewerbungsunterlagen" } } }] }

Request
Example
JSON
Moving a
object from a
Register to a new
location

{ "objects": [{ "properties": { "system:objectId": { "value": "3652354" // The object id of the object to move }, "system:objectTypeId": { "value": "6488100" // Optional: The object type id of the object to move }, "system:parentId": { "value": "83652" // The osId of the new parent object }, "system:parentObjectTypeId": { "value": "6488100" // Optional: The object type id of the new parent object }, "system:REGISTERID": { "value": "83665" // The osId of the current parent } } }] }

Request
Example
JSON
Moving a
object from a
Folder to a new
location

{ "objects": [{ "properties": { "system:objectId": { "value": "3652354" // The object id of the object to move }, "system:objectTypeId": { "value": "6488100" // Optional: The object type id of the object to move }, "system:parentId": { "value": "83652" // The osId of the new parent object }, "system:parentObjectTypeId": { "value": "6488100" // Optional: The object type id of the new parent object }, "system:FOLDERID": { "value": "83665" // The osId of the current parent } } }] }

Request
Example
JSON
setting a
document object
archivable

{ "objects": [{ "properties": { "system:objectId": { "value": "123625" // The object id of the object }, "system:objectTypeId": { "value": "262125" // Optional: The object type id of the object } }, "options": { "ARCHIVABLE": 1 } }] }

Request
Example
JSON
creating a reference document
("green arrow")

{ "objects": [{ "properties": { "system:OBJECT_FOREIGNID": { "value": "123625" // The source object id }, "system:OBJECT_SYSTEMID": { "value": "0" }, "system:objectTypeId": { "value": "262125" // The object type id of the object to create }, "system:parentId": { "value": "8663" // The folder or register object id to insert into }, // All further mask fields which should be set } }] }

Request
Example
JSON
creating a link
to an additional
location

{     "objects": [{         "properties": {             "system:objectId": {                 "value": "41087"             }, "system:objectTypeId": { "value": "262125" },             "system:parentId": {                 "value": "41080"             }         },         "options": {             "LINKDOCUMENT": 1         }     }] }

Request
Example
Multipart
creating a
typeless user-tray
object

POST /api/dms/objects HTTP/1.1 Accept: application/json, application/*+json Content-Type: multipart/form-data;boundary=Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH User-Agent: Java/1.8.0_60 Connection: keep-alive Content-Length: 83258 Host: 127.0.0.1:7400 --Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH Content-Disposition: form-data; name="data" Content-Type: application/json;charset=UTF-8 { "objects": [{ "properties": { "system:parentId": { "value": "system:tray" }, "system:objectTypeId": { "value": "system:typeless" }, "system:mainType": { "value": "4" } }, "contentStreams": [{ "mimeType": "message/rfc822", "fileName": "upload.eml", "cid": "cid_63apple" }] }] } --Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH Content-Disposition: form-data; name="cid_63apple"; filename="upload.eml" Content-ID: cid_63apple Content-Type: message/rfc822 From: Garco Meissler <garco@example.de> To: Dudreas Annkel <dudreas@example.de> Cc: Kruedeas Anger <kruedeas@example.de> Message-ID: <12716821.1.1500391295036.JavaMail.meissler@APGMEISSLER> Subject: =?UTF-8?Q?Bewerbungsunterlagen?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_16468615.1500391295024" ------=_Part_0_16468615.1500391295024 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy ei= rmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam volu= ptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita k= asd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore= ... en, no sea takimata sanctus est Lore ------=_Part_0_16468615.1500391295024--

Request
Example
Multipart
creating a
typeless workflow-tray
object

POST /api/dms/objects HTTP/1.1 Accept: application/json, application/*+json Content-Type: multipart/form-data;boundary=Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH User-Agent: Java/1.8.0_60 Connection: keep-alive Content-Length: 83258 Host: 127.0.0.1:7400 --Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH Content-Disposition: form-data; name="data" Content-Type: application/json;charset=UTF-8 { "objects": [{ "properties": { "system:parentId": { "value": "system:workflowtray" }, "system:objectTypeId": { "value": "system:typeless" }, "system:mainType": { "value": "4" } }, "contentStreams": [{ "mimeType": "message/rfc822", "fileName": "upload.eml", "cid": "cid_63apple" }] }] } --Jn3QCX9rHAFQaofW6vsdoz5CsD5_P0PZhH Content-Disposition: form-data; name="cid_63apple"; filename="upload.eml" Content-ID: cid_63apple Content-Type: message/rfc822 From: Garco Meissler <garco@example.de> To: Dudreas Annkel <dudreas@example.de> Cc: Kruedeas Anger <kruedeas@example.de> Message-ID: <12716821.1.1500391295036.JavaMail.meissler@APGMEISSLER> Subject: =?UTF-8?Q?Bewerbungsunterlagen?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_16468615.1500391295024" ------=_Part_0_16468615.1500391295024 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy ei= rmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam volu= ptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita k= asd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore= ... en, no sea takimata sanctus est Lore ------=_Part_0_16468615.1500391295024--

Result
Example

See 1.3 Result Format