Storing a new DMS object without user interaction

You can store a new DMS object automatically in the d.3 repository without the need for action by the user. No Validate hooks are executed in d.3 server during storing without user interaction. Mappings are required before the action can be performed. In the Basic information about mapping chapter, you can find general information for helping you to create mappings.

Perform the following steps to store a DMS object:

  • Determining the URL for a repository

  • Determine the link relation for storing a new DMS object

  • Provide the file to be stored (optional)

  • Open the URL for storing a new DMS object

Determining the URL for a repository

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

Determining the link relation for storing a new DMS object

You open the URL for a repository as follows:

Request

GET /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27
Accept: application/hal+json

The JSON object for a repository contains the link relation dmsobjectwithmapping.

Response

{
        "_links": {
                "dmsobjectwithmapping": {
                        "href": "/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/{dmsobjectid}{?sourceid}",
                        "templated":true
                }
        },
        "id": "dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27"
}

The values dmsobjectid and sourceid are not relevant for storage. They do not need to be filled when executing the template.

Provide the file to be stored (optional)

The Provision of files chapter explains how to obtain the contentUri or contentLocationUri. These parameters are required for storing a new DMS object.

If you want to create a dossier, you do not need to provide the file.

Open the URL for storing a new DMS object

Perform an HTTP POST request to this URL with the required properties as Body.

Request

POST /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m
Origin: https://baseuri
Accept: application/hal+json
Content-Type: application/hal+json

{
        "filename": "myfile.txt",
        "sourceCategory": "mycategory1_ID",
        "sourceId": "/myapp/sources/mysource",
        "contentLocationUri": "/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/blob/chunk/2018-01-01_temp_master_file_user1_44f7-95a6-58b8400ecf43",
        "sourceProperties": {
                "properties": [{
                                "key": "myprop1_ID",
                                "values": ["Please verify the XYZ invoice"]
                        },
                        {
                                "key": "myprop2_ID",
                                "values": ["Name1@contoso.com","Name2@samplecompany.de"]
                        }
                ],
        }
}

For information about the JSON object parameters, see the chapter Defining the parameters for storing.

If no assignment is configured for the d.3 document status, the document status Release (Release) is used by default for the DMS object. The Status property must be assigned by the administrator if you want to use a different document status during storage.

If the call is successful, the URL is returned to the DMS object in the Location header:

If linking an item to a dossier (parentId) fails, you will receive the URL to the DMS object in the Location header, as well as an additional notification that the linking process has failed.

Response

HTTP/1.1 201 Created
Location: /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/D0001234?sourceId=%2Fmyapp%2Fsources%2Fmysourc

{
        "reason": "You do not have the right to link the document with the dossier manually.
Nevertheless, the document was successfully saved. The document may be automatically linked on the server."
        "severity": 1
}

If the call was successful and there is detailed information on the processing result of the storage operation, the detailed information is returned in the response. With the help of the information, you can decide whether further processing steps are necessary for the DMS object. For more information see Format of the response for successful requests with detailed information.

If storing the DMS object fails, an appropriate answer is displayed. For more information see Response format for errors.