Persist directories

/dam/dirs/persist Persist a list of directories.
Table 1. Details

Resource path

/api/core/v1/dam/dirs/persist

HTTP method

POST

Request content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Directory attributes

Directory attributes are stored in DirectoryType.vals

Directory attributes type and examples
Attribute type Is localized Response template Example

Boolean

<val attr="{attribute_name}">
    <itm>{attribute_value}</itm>
</val>
<val attr="BOOLEAN_SIMPLE">
    <itm>false</itm>
</val>

Boolean

X

<val attr="{attribute_name}" type="localized">
    <itm loc="{language_code}">{attribute_value}</itm>
</val>
<val attr="BOOLEAN_LANGUAGE" type="localized">
    <itm loc="en_EN">true</itm>
</val>

Date

<val attr="{attribute_name}">
    <itm>{iso8601_date}</itm>
</val>
<val attr="DATE_SIMPLE">
    <itm>2022-06-11T13:05:32.000Z</itm>
</val>

Date

X

<val attr="{attribute_name}" type="localized">
    <itm loc="{language_code}">{iso8601_date}</itm>
</val>
<val attr="DATE_LANGUAGE" type="localized">
    <itm loc="en_EN">2022-06-04T13:05:32.000Z</itm>
</val>

Enumeration

<val attr="{attribute_name}" type="multiple">
    <itm pos="0">{attribute_value0}</itm>
    <itm pos="1">{attribute_value1}</itm>
    <itm pos="N">{attribute_valuen}</itm>
</val>
<val attr="ENUMERATION_SIMPLE" type="multiple">
    <itm pos="0">value0</itm>
    <itm pos="1">value1</itm>
    <itm pos="2">value2</itm>
</val>

Enumeration

X

<val attr="{attribute_name}" type="multi_loc">
    <i18n loc="{language_code}">
        <itm pos="0">{attribute_value0}</itm>
        <itm pos="1">{attribute_value1}</itm>
        <itm pos="N">{attribute_valuen}</itm>
    </i18n>
</val>
<val attr="ENUMERATION_LANGUAGE" type="multi_loc">
    <i18n loc="en_EN">
        <itm pos="0">value0</itm>
        <itm pos="1">value1</itm>
        <itm pos="2">value2</itm>
    </i18n>
</val>

Number

<val attr="{attribute_name}">
    <itm>{attribute_value}</itm>
</val>
<val attr="NUMBER_SIMPLE">
    <itm>33</itm>
</val>

Number

X

<val attr="{attribute_name}" type="localized">
    <itm loc="{language_code}">{value}</itm>
</val>
<val attr="NUMBER_LANGUAGE" type="localized">
    <itm loc="en_EN">77</itm>
</val>

String

<val attr="{attribute_name}">
    <itm>{attribute_value}</itm>
</val>
<val attr="NUMBER_SIMPLE">
    <itm>33</itm>
</val>

String

X

<val attr="{attribute_name}" type="localized">
     <itm>{attribute_value}</itm>
</val>
<val attr="STRING_SIMPLE">
    <itm>temp</itm>
</val>
Body parameters

Specified by DirectoryType

  • rnc: root node configuration

  • tid: unique identifier

  • parent: parent directory unique identifier

  • name: new directory name

Directory attributes can be persisted in the same request with directory. See Directory attributes
Return Type

PimType with filled ResponsesType

Responses
Table 2. Http response codes
Code Message Datatype

200

PimType with list of successful or error ResponseTypes

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
1. Create a directory:
1.1. Create in the given RNC
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/dirs/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir rnc="MAM">
            <name>New directory</name>
        </dir>
    </dirs>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir rnc="MAM">
            <name>New Directory</name>
        </dir>
    </dirs>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-05-13T16:20:23.420Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir"
                tid="7D534991-B623-418C-A7CB-A273C877A37D"
                action="create">
            <status>SUCCESS</status>
            <description>The directory has been saved successfully</description>
        </response>
    </responses>
</pim>
1.2. Create in the given parent directory
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/dirs/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir parent="63FBCD05-4DB0-42D5-AB13-C87F3366CA82">
            <name>New directory</name>
        </dir>
    </dirs>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir parent="483AAC0B-57F2-4B70-95F9-FF1DAD9AA9C6">
            <name>New Directory</name>
        </dir>
    </dirs>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-05-13T16:20:23.420Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir"
                tid="7D534991-B623-418C-A7CB-A273C877A37D"
                action="create">
            <status>SUCCESS</status>
            <description>The directory has been saved successfully</description>
        </response>
    </responses>
</pim>
Error responses
Missing directory parameter 'name'
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>Missing directory parameter 'name'"</description>
        </response>
    </responses>
</pim>
2. Update a directory
2.1. Update in the given RNC
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/dam/dirs/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir tid="7D534991-B623-418C-A7CB-A273C877A37D" rnc="MAM">
            <name>Updated Directory</name>
        </dir>
    </dirs>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir tid="7D534991-B623-418C-A7CB-A273C877A37D" rnc="MAM">
            <name>Updated Directory</name>
        </dir>
    </dirs>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-05-13T16:25:28.200Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir"
                tid="7D534991-B623-418C-A7CB-A273C877A37D"
                action="update">
            <status>SUCCESS</status>
            <description>The directory has been saved successfully</description>
        </response>
    </responses>
</pim>
2.2. Update in the parent directory
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/dam/dirs/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir tid="41A7CF7F-60DA-4F76-8288-D9721389812A" parent="778B4AFD-6EC5-45D8-95B4-DA2213243B77">
            <name>Updated Directory</name>
        </dir>
    </dirs>
</pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <dirs>
        <dir tid="41A7CF7F-60DA-4F76-8288-D9721389812A" parent="778B4AFD-6EC5-45D8-95B4-DA2213243B77">
            <name>Updated Directory</name>
        </dir>
    </dirs>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-05-13T16:25:28.200Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir"
                tid="7D534991-B623-418C-A7CB-A273C877A37D"
                action="update">
            <status>SUCCESS</status>
            <description>The directory has been saved successfully</description>
        </response>
    </responses>
</pim>
Error responses
Move directory to itself or to the parent directory
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="update">
            <status>ERROR</status>
            <description>"Target directory is itself or target parent directory"</description>
        </response>
    </responses>
</pim>
Missing directory parameter 'name' when updating
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="update">
            <status>ERROR</status>
            <description>Missing directory parameter 'name'</description>
        </response>
    </responses>
</pim>
Common error responses
Directory attributes missing
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>Directory attributes missing: 'rnc' or 'parent' attribute must be</description>
        </response>
    </responses>
</pim>
Directory attributes mismatched
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>There must be only one of the attributes - 'rnc' or 'parent'</description>
        </response>
    </responses>
</pim>
Permissions missing
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>Permissions missing for directory with tid '7D534991-B623-418C-A7CB-A273C877A37D'</description>
        </response>
    </responses>
</pim>
RNC not found
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>Cannot find RNC with identifier 'MAM'</description>
        </response>
    </responses>
</pim>
Directory already exists
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>Directory with name 'Directory' already exists</description>
        </response>
    </responses>
</pim>
Parent directory not found
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>Directory not found</description>
        </response>
    </responses>
</pim>
File Management Synchronizer error
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="create">
            <status>ERROR</status>
            <description>File Management Synchronizer error</description>
        </response>
    </responses>
</pim>
Directory not found
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-07-06T11:45:41.247Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="dir" action="update">
            <status>ERROR</status>
            <description>Cannot find directory with tid '7D534991-B623-418C-A7CB-A273C877A37D'</description>
        </response>
    </responses>
</pim>

Welcome to the AI Chat!

Write a prompt to get started...