Linking DMS objects

Released: JSON representation

In this chapter, you can learn how to link DMS objects with other DMS objects hierarchically independent from their type.

To link DMS objects to each other, perform the following steps:

  • Determining the URL for a repository

  • Determine and open the link relation for retrieving the details of a DMS object

  • Determine the link relation for linking DMS objects

  • Linking DMS objects

Determining the URL for a repository

In the chapter Determining a repository, you can learn how to determine the URL for a repository.

Determine and open the link relation for retrieving the details of a DMS object

In the chapter Retrieving and viewing the details of a DMS object, you can learn how to determine and open the URL for retrieving the details of a DMS object.

Determine the link relation for linking DMS objects

The JSON object for the details of a DMS object contains the link relation linkDmsObjects, which you can use to link DMS objects.

Response

{ 
    "_links": {   
        "linkDmsObjects":{
            "href": "/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/D000000123/children"
        }
    },
    "id": "D000000123" 
}

Linking DMS objects

To link a DMS object to the transferred DMS objects, execute an HTTP POST request with the list of IDs of the DMS objects to be linked as the body to the URL determined above as follows:

Request

POST https://host/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/D000000123/children HTTP/1.1
Accept: application/hal+json

Content-Type: application/hal+json

{
    "dmsObjectIds": [
        "D000000089",
        "D000000127",
        "D000004567",
    ]
}

The JSON object that is transferred to POST is described as follows:

Property

Description

dmsObjectIds

Specifies the array with the IDs of the DMS objects (of the String type) that are to be linked to the DMS object.

As the response, you receive the HTTP status code 200 (OK) if the link was successful. If the link was not successful or was successful only for individual DMS objects, you receive the HTTP status code 207 (multi-status) and a list with detailed information about the individual link operations.

Example of a response to a partly failed request:

Response

HTTP/1.1 207 Multi-Status
Content-Type: application/hal+json
 
{
 "requestId": "XyErwIKPhyGaMg9dxcGksgAAA@A",
 "linkDocumentErrorPageModels": [
   {
     "dmsObjectId": "D000000089",
     "errorPageModel": {
       "reason": "These documents are already linked to each other! [0000071] ",
       "severity": 1,
       "errorCode": 71
     }
   },
   {
     "dmsObjectId": "D000000127",
     "errorPageModel": {
       "reason": "These documents are already linked to each other! [0000071] ",
       "severity": 1,
       "errorCode": 71
     }
   },
   {
     "dmsObjectId": "D000004567",
     "errorPageModel": {
       "reason": "These documents are already linked to each other! [0000071] ",
       "severity": 1,
       "errorCode": 71
     }
   }
 ]
}

Description of parameters for response upon a failed request:

Property

Description

requestId

ID of the associated request During additional requests, the ID is transferred to other apps and serves tracing purposes when an action is processed.

linkDocumentErrorPageModels

An array with error messages for a link operation.

Structure of a response object for a link operation

Property

Description

dmsObjectId

The ID of the DMS object to be linked.

errorPageModel

An object with a description of whether the link was successful.

Response format for errors

Property

Description

errorCode

An optional error code, as returned by d.3 server.

reason

An optional short description of why the error has occurred. This text is used as the error message’s title.

severity

Optional error severity. Possible values are:

Success = 0,
Information = 1,
Warning = 2,
Error = 3