{"id":29910,"date":"2023-12-20T08:58:56","date_gmt":"2023-12-20T07:58:56","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=29910"},"modified":"2026-02-25T21:45:54","modified_gmt":"2026-02-25T20:45:54","slug":"howto-work-with-files-in-documentum-iapi","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/","title":{"rendered":"HowTo &#8211; Work with files in Documentum iAPI"},"content":{"rendered":"\n<p>As part of my daily work at our Documentum customers, I often have to work on files like creating some dummy documents, retrieving the content of a specific document on the file system, etc\u2026 Documentum does that well internally and some of it can be done through some UIs, like Documentum Administrator, but you don&#8217;t always have access to these UIs and not everything can be done there. Therefore, being able to do that through command-line, iAPI particularly, is a nice-to-have for any people managing Documentum installations. In this blog, I will go through the commands and steps needed to execute particularly useful things.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-import-a-content-from-the-file-system\">Import a content from the File System<\/h2>\n\n\n\n<p>Let&#8217;s start this blog with something quite simple: attaching a content to an existing object in Documentum. For that purpose, I will first fetch said object and then use &#8220;<em>setfile<\/em>&#8221; to attach a content to it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [5,6,7,24,26,28]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ r_object_id=&quot;0901234580415f00&quot; #dm_document.r_object_id\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${r_object_id}\n&gt; get,c,l,r_content_size\n&gt; setfile,c,l,\/tmp\/file_content_1.docx,msw12\n&gt; get,c,l,r_content_size\n&gt; save,c,l\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc6ff started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\n113479\nAPI&gt; ...\nOK\nAPI&gt; ...\n12586\nAPI&gt; ...\nOK\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>The content of this document was 113479 bytes before and 12586 bytes after the update.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-export-a-content-to-the-file-system\">Export a content to the File System<\/h2>\n\n\n\n<p>If you can set a content of an existing object from the file system, you can also do the other way around and export the content to the file system. For that, it&#8217;s the &#8220;<em>getfile<\/em>&#8221; this time:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,2,6,22,25,26,30,31,32]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ ls -l \/tmp\/file_exported*\nls: cannot access \/tmp\/file_exported*: No such file or directory\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${r_object_id}\n&gt; getfile,c,l,\/tmp\/file_exported.docx\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc712 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\n\/tmp\/file_exported.docx\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ ls -l \/tmp\/file_exported*\n-rw-r----- 1 dmadmin dmadmin  12586 Dec 19 12:10 \/tmp\/file_exported.docx\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ diff \/tmp\/file_exported.docx \/tmp\/file_content_1.docx\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ md5sum \/tmp\/file_exported.docx \/tmp\/file_content_1.docx\na84d45bd4e57a7c105bae574b32985ae  \/tmp\/file_exported.docx\na84d45bd4e57a7c105bae574b32985ae  \/tmp\/file_content_1.docx\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>As you can see, the exported file is the same as the file we uploaded earlier, as we can expect. In this case, you need to know the extension of the file to set a correct name. You can, of course, export it without extension or with a dummy one, as long as you know which application will be able to open it (if you need to open it for any investigation or similar reasons).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-import-a-content-from-the-file-system-on-a-protected-immutable-frozen-object-e-g-tbo\">Import a content from the File System on a protected\/immutable\/frozen object (e.g.: TBO)<\/h2>\n\n\n\n<p>In case you have to work on some protected\/immutable\/frozen objects, such as the TBO (immutable), then you will have to first &#8220;<em>checkout<\/em>&#8221; and then &#8220;<em>checkin<\/em>&#8221; the object to be able to update its content, still with the &#8220;<em>setfile<\/em>&#8221; in the middle:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [3,4,5,21,23,25]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${r_object_id}\n&gt; checkout,c,l\n&gt; setfile,c,l,\/tmp\/lstbo.jar\n&gt; checkin,c,l\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc745 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\n0901234580415f00\nAPI&gt; ...\nOK\nAPI&gt; ...\n090123458042dff9\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>In this case, you don&#8217;t need to save the object, the &#8220;<em>checkin<\/em>&#8221; will do that automatically when it creates a new version with the new content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-create-a-new-file\">Create a new file<\/h2>\n\n\n\n<p>If you don&#8217;t have an object yet, you can create a new one with all the needed details. For that, you will need to use &#8220;<em>create<\/em>&#8220;, then all the needed &#8220;<em>set<\/em>&#8220;\/&#8221;<em>setfile<\/em>&#8220;\/&#8221;<em>link<\/em>&#8220;\/whatever as required for your new document:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [3,6,7,8,9,10,11,12,26,34,39]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ ls -ltr \/tmp\/file_content*\n-rwxr-x--- 1 dmadmin dmadmin  12586 Dec 15 16:45 \/tmp\/file_content_1.docx\n-rwxr-x--- 1 dmadmin dmadmin 113479 Dec 15 16:46 \/tmp\/file_content_2.docx\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; create,c,dm_document\n&gt; set,c,l,object_name\n&gt; test_document\n&gt; setfile,c,l,\/tmp\/file_content_2.docx,msw12\n&gt; link,c,l,&#039;\/dmadmin&#039;\n&gt; get,c,l,r_content_size\n&gt; save,c,l\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc770 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\n090123458042e00d\nAPI&gt; SET&gt; ...\nOK\nAPI&gt; ...\nOK\nAPI&gt; ...\nOK\nAPI&gt; ...\n113479\nAPI&gt; ...\nOK\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ r_object_id=&quot;090123458042e00d&quot;\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>Once the document is created, you can then work on it as usual, changing its content, creating new versions, deleting it, etc\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-retrieve-the-file-system-path-of-a-file-from-the-repo\">Retrieve the File System path of a file from the Repo<\/h2>\n\n\n\n<p>From time to time, you will need to investigate the source content of an object, maybe because it&#8217;s not present anymore or it&#8217;s not what you expected, things like that. For that purpose, you have two main solutions, the easy and the hard way. The easy one will just use the &#8220;<em>getpath<\/em>&#8221; command provided and the hard one will use some &#8220;<em>get<\/em>&#8221; on different objects to be able to reconstruct the path yourself (why would you want to do it the hard way? to show you can do it, of course! :D).<\/p>\n\n\n\n<p>The easy way:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [4,20,25,26,27]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ # Easy way\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${r_object_id}\n&gt; getpath,c,l\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc7a4 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\n\/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ diff \/tmp\/file_content_2.docx \/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ md5sum \/tmp\/file_content_2.docx \/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\nfc3afe90ae970ccab544b3005be1f6ea  \/tmp\/file_content_2.docx\nfc3afe90ae970ccab544b3005be1f6ea  \/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>A &#8220;long&#8221; version of the hard way, that requires multiple sessions (because you need to get some IDs to use them on follow-up queries):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [3,4,20,23,26,27,28,44,46,49,52,53,69,72,75,76,92,95]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ # Hard way - long version\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${r_object_id}\n&gt; get,c,l,i_contents_id\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc7ab started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\n06012345800ae6d4\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ i_contents_id=&quot;06012345800ae6d4&quot;\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${i_contents_id}\n&gt; get,c,l,storage_id\n&gt; get,c,l,data_ticket\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc7ae started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\n2801234580000100\nAPI&gt; ...\n-2146807561\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ storage_id=&quot;2801234580000100&quot;\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; fetch,c,${storage_id}\n&gt; get,c,l,root\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc842 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\nOK\nAPI&gt; ...\nstorage_01\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ root=&quot;storage_01&quot;\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; retrieve,c,dm_location where object_name=&#039;${root}&#039;\n&gt; get,c,l,file_system_path\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc848 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\n3a0123458000013f\nAPI&gt; ...\n\/data\/dctm\/REPO01\/content_storage_01\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ file_system_path=&quot;\/data\/dctm\/REPO01\/content_storage_01&quot;\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>As you can see above, there are quite a few steps to get the needed information manually. From that point, you need to transform the &#8220;<em>data_ticket<\/em>&#8221; from a decimal to a hexadecimal signed 2&#8217;s complement on 8 digits. You can do that with an online website like <a href=\"https:\/\/www.rapidtables.com\/convert\/number\/decimal-to-hex.html\" target=\"_blank\" rel=\"noreferrer noopener\">this one<\/a>, put your &#8220;<em>data_ticket<\/em>&#8221; into the &#8220;Enter decimal number&#8221;, click on &#8220;Convert&#8221; and look at the &#8220;Hex signed 2&#8217;s complement (8 digits)&#8221; value. You can also do that through bash (basically, you add 2^32 to the value of &#8220;<em>data_ticket<\/em>&#8221; and then you transform that value to hexadecimal):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ # Add 2^32 to data_ticket and then transform to hexadecimal\n&#x5B;dmadmin@cs-0 ~]$ data_ticket=&quot;-2146807561&quot;\n&#x5B;dmadmin@cs-0 ~]$ hex_path=&quot;$(echo ${data_ticket} | gawk &#039;{printf(&quot;%x\\n&quot;, $0 + 2**32)}&#039;)&quot;\n&#x5B;dmadmin@cs-0 ~]$ echo ${hex_path}\n800a50f7\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Add \/ every 2 characters for the folder separator\n&#x5B;dmadmin@cs-0 ~]$ doc_path=&quot;$(echo ${hex_path} | sed &#039;s,..,\/&amp;,g;s,^\/,,&#039;)&quot;\n&#x5B;dmadmin@cs-0 ~]$ echo ${doc_path}\n80\/0a\/50\/f7\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>With the above, we have:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>file_system_path = \/data\/dctm\/REPO01\/content_storage_01<\/li>\n\n\n\n<li>data_ticket = -2146807561\n<ol class=\"wp-block-list\">\n<li>hex value from data_ticket = 800a50f7\n<ol class=\"wp-block-list\">\n<li>document path on file system based on hex value from data_ticket = 80\/0a\/50\/f7<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n\n\n\n<p>Therefore, the file system path of this document is: <em>\/data\/dctm\/REPO01\/content_storage_01\/${docbase_id}\/80\/0a\/50\/f7*<\/em> (concatenation of &#8220;<em>file_system_path<\/em>&#8221; ++ docbase id ++ doc path derived from the &#8220;<em>data_ticket<\/em>&#8221; (hex value split every 2 characters by a slash)). The extension of the file will be the present on the file system as well, you could fetch it from the repository too, but there is no real need, since there should be only 1 result anyway. To verify that you can find the file on the file system:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ echo ${r_object_id}\n090123458042e00d\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Extract the Docbase ID from any r_object_id\n&#x5B;dmadmin@cs-0 ~]$ docbase_id=&quot;00${r_object_id:2:6}&quot;\n&#x5B;dmadmin@cs-0 ~]$ echo ${docbase_id}\n00012345\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Concatenate the different variables needed to form the path\n&#x5B;dmadmin@cs-0 ~]$ echo ${file_system_path}\/${docbase_id}\/${doc_path}\n\/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Verify that the file exists\n&#x5B;dmadmin@cs-0 ~]$ ls -ltr ${file_system_path}\/${docbase_id}\/${doc_path}*\n-rw------- 1 dmadmin dmadmin 113479 Dec 19 10:06 \/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>We find the same file as what the &#8220;<em>getpath<\/em>&#8221; command returned on the &#8220;Easy way&#8221; section above, so that&#8217;s a success\u2026 As you can see it&#8217;s a little bit more gymnastic than simply using a command that OpenText provides (for a good reason!).<\/p>\n\n\n\n<p>If you want a shorter version of the &#8220;Hard way&#8221;, to avoid the multiple jumps between objects, you can use something like the following, where only the &#8220;r_object_id&#8221; is required:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [3,4,5,6,22,26]; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ # Hard way - short version\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; retrieve,c,dmr_content where r_object_id IN (select i_contents_id from dm_document where r_object_id=&#039;${r_object_id}&#039;)\n&gt; get,c,l,data_ticket\n&gt; retrieve,c,dm_location where object_name IN (select root from dm_filestore where r_object_id IN (select storage_id from dmr_content where r_object_id IN (select i_contents_id from dm_document where r_object_id=&#039;${r_object_id}&#039;)))\n&gt; get,c,l,file_system_path\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc8ec started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; ...\n06012345800ae6d4\nAPI&gt; ...\n-2146807561\nAPI&gt; ...\n3a0123458000013f\nAPI&gt; ...\n\/data\/dctm\/REPO01\/content_storage_01\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>With that, the same &#8220;<em>data_ticket<\/em>&#8221; and &#8220;<em>file_system_path<\/em>&#8221; are returned, and you need to do the transformation as it was done previously, to get the final path on the file system\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-retrieve-the-repo-object-from-the-file-system-path-of-a-file\">Retrieve the Repo Object from the File System path of a file<\/h2>\n\n\n\n<p>If you can do it one way, you can of course do it the other way as well. This could be useful if you know some files were removed on the file system or some were corrupted because of the storage, and you want to find which documents they relates to in Documentum. As previously, you can use the online website to transform back from a hexadecimal 2&#8217;s complement to a decimal (10 digits) or you can do it via bash:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ ls -l \/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\n-rw------- 1 dmadmin dmadmin 113479 Dec 19 10:06 \/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Setting the initial variable with the path of existing file\n&#x5B;dmadmin@cs-0 ~]$ file_path=&quot;\/data\/dctm\/REPO01\/content_storage_01\/00012345\/80\/0a\/50\/f7.docx&quot;\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Extracting only the last 3 folders + file name\n&#x5B;dmadmin@cs-0 ~]$ doc_path=&quot;$(echo ${file_path} | awk -F \/ -v OFS=\/ &#039;{ print $(NF-3), $(NF-2), $(NF-1), $NF }&#039;)&quot;\n&#x5B;dmadmin@cs-0 ~]$ echo ${doc_path}\n80\/0a\/50\/f7.docx\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Removing the file extension and \/ separator\n&#x5B;dmadmin@cs-0 ~]$ hex_path=&quot;$(echo ${doc_path} | sed &#039;s,\/,,g;s,\\..*,,&#039;)&quot;\n&#x5B;dmadmin@cs-0 ~]$ echo ${hex_path}\n800a50f7\n&#x5B;dmadmin@cs-0 ~]$\n&#x5B;dmadmin@cs-0 ~]$ # Transform to decimal and then substract 2^32\n&#x5B;dmadmin@cs-0 ~]$ data_ticket=&quot;$(( 16#${hex_path} - 2**32 ))&quot;\n&#x5B;dmadmin@cs-0 ~]$ echo ${data_ticket}\n-2146807561\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>From there, Documentum can give you the document that is using this &#8220;<em>data_ticket<\/em>&#8220;:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;dmadmin@cs-0 ~]$ iapi $DOCBASE_NAME -Udmadmin -Pxxx &lt;&lt; EOC\n&gt; ?,c,select r_object_id, object_name from dm_sysobject(all) where r_object_id in (select parent_id_i from dmr_content where data_ticket=&#039;${data_ticket}&#039;);\n&gt; EOC\n\n        OpenText Documentum iapi - Interactive API interface\n        Copyright (c) 2020. OpenText Corporation\n        All rights reserved.\n        Client Library Release 20.2.0000.0082\n\nConnecting to Server using docbase REPO01\n&#x5B;DM_SESSION_I_SESSION_START]info:  &quot;Session 01012345800fc9b3 started for user dmadmin.&quot;\n\nConnected to OpenText Documentum Server running Release 20.2.00013.0135  Linux64.Oracle\nSession id is s0\nAPI&gt; \nr_object_id       object_name\n----------------  --------------\n090123458042e00d  test_document\n(1 row affected)\n\nAPI&gt; Bye\n&#x5B;dmadmin@cs-0 ~]$\n<\/pre><\/div>\n\n\n<p>That is indeed the document that was created previously for this blog, so that&#8217;s another success.<\/p>\n\n\n\n<p>There are plenty of other useful iAPI commands to use but I think that&#8217;s long enough for this blog. Maybe another one later?<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of my daily work at our Documentum customers, I often have to work on files like creating some dummy documents, retrieving the content of a specific document on the file system, etc\u2026 Documentum does that well internally and some of it can be done through some UIs, like Documentum Administrator, but you don&#8217;t [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[525],"tags":[2609,809,3207,233],"type_dbi":[],"class_list":["post-29910","post","type-post","status-publish","format-standard","hentry","category-enterprise-content-management","tag-documentum-2","tag-file","tag-howto","tag-iapi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>HowTo - Work with files in Documentum iAPI - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HowTo - Work with files in Documentum iAPI\" \/>\n<meta property=\"og:description\" content=\"As part of my daily work at our Documentum customers, I often have to work on files like creating some dummy documents, retrieving the content of a specific document on the file system, etc\u2026 Documentum does that well internally and some of it can be done through some UIs, like Documentum Administrator, but you don&#8217;t [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-20T07:58:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-25T20:45:54+00:00\" \/>\n<meta name=\"author\" content=\"Morgan Patou\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MorganPatou\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Morgan Patou\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\"},\"author\":{\"name\":\"Morgan Patou\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8\"},\"headline\":\"HowTo &#8211; Work with files in Documentum iAPI\",\"datePublished\":\"2023-12-20T07:58:56+00:00\",\"dateModified\":\"2026-02-25T20:45:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\"},\"wordCount\":1052,\"commentCount\":0,\"keywords\":[\"Documentum\",\"file\",\"HowTo\",\"iapi\"],\"articleSection\":[\"Enterprise content management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\",\"name\":\"HowTo - Work with files in Documentum iAPI - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2023-12-20T07:58:56+00:00\",\"dateModified\":\"2026-02-25T20:45:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HowTo &#8211; Work with files in Documentum iAPI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8\",\"name\":\"Morgan Patou\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g\",\"caption\":\"Morgan Patou\"},\"description\":\"Morgan Patou has over 12 years of experience in Enterprise Content Management (ECM) systems, with a strong focus in recent years on platforms such as Alfresco, Documentum, and M-Files. He specializes in the architecture, setup, customization, and maintenance of ECM infrastructures in complex &amp; critical environments. Morgan is well-versed in both engineering and operations aspects, including high availability design, system integration, and lifecycle management. He also has a solid foundation in open-source and proprietary technologies - ranging from Apache, OpenLDAP or Kerberos to enterprise-grade systems like WebLogic. Morgan Patou holds an Engineering Degree in Computer Science from ENSISA (\u00c9cole Nationale Sup\u00e9rieure d'Ing\u00e9nieurs Sud Alsace) in Mulhouse, France. He is Alfresco Content Services Certified Administrator (ACSCA), Alfresco Content Services Certified Engineer (ACSCE) as well as OpenText Documentum Certified Administrator. His industry experience spans the Public Sector, IT Services, Financial Services\/Banking, and the Pharmaceutical industry.\",\"sameAs\":[\"https:\/\/blog.dbi-services.com\/author\/morgan-patou\/\",\"https:\/\/x.com\/MorganPatou\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/morgan-patou\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"HowTo - Work with files in Documentum iAPI - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/","og_locale":"en_US","og_type":"article","og_title":"HowTo - Work with files in Documentum iAPI","og_description":"As part of my daily work at our Documentum customers, I often have to work on files like creating some dummy documents, retrieving the content of a specific document on the file system, etc\u2026 Documentum does that well internally and some of it can be done through some UIs, like Documentum Administrator, but you don&#8217;t [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/","og_site_name":"dbi Blog","article_published_time":"2023-12-20T07:58:56+00:00","article_modified_time":"2026-02-25T20:45:54+00:00","author":"Morgan Patou","twitter_card":"summary_large_image","twitter_creator":"@MorganPatou","twitter_misc":{"Written by":"Morgan Patou","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/"},"author":{"name":"Morgan Patou","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8"},"headline":"HowTo &#8211; Work with files in Documentum iAPI","datePublished":"2023-12-20T07:58:56+00:00","dateModified":"2026-02-25T20:45:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/"},"wordCount":1052,"commentCount":0,"keywords":["Documentum","file","HowTo","iapi"],"articleSection":["Enterprise content management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/","url":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/","name":"HowTo - Work with files in Documentum iAPI - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2023-12-20T07:58:56+00:00","dateModified":"2026-02-25T20:45:54+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/howto-work-with-files-in-documentum-iapi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"HowTo &#8211; Work with files in Documentum iAPI"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8","name":"Morgan Patou","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g","caption":"Morgan Patou"},"description":"Morgan Patou has over 12 years of experience in Enterprise Content Management (ECM) systems, with a strong focus in recent years on platforms such as Alfresco, Documentum, and M-Files. He specializes in the architecture, setup, customization, and maintenance of ECM infrastructures in complex &amp; critical environments. Morgan is well-versed in both engineering and operations aspects, including high availability design, system integration, and lifecycle management. He also has a solid foundation in open-source and proprietary technologies - ranging from Apache, OpenLDAP or Kerberos to enterprise-grade systems like WebLogic. Morgan Patou holds an Engineering Degree in Computer Science from ENSISA (\u00c9cole Nationale Sup\u00e9rieure d'Ing\u00e9nieurs Sud Alsace) in Mulhouse, France. He is Alfresco Content Services Certified Administrator (ACSCA), Alfresco Content Services Certified Engineer (ACSCE) as well as OpenText Documentum Certified Administrator. His industry experience spans the Public Sector, IT Services, Financial Services\/Banking, and the Pharmaceutical industry.","sameAs":["https:\/\/blog.dbi-services.com\/author\/morgan-patou\/","https:\/\/x.com\/MorganPatou"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/morgan-patou\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/29910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=29910"}],"version-history":[{"count":7,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/29910\/revisions"}],"predecessor-version":[{"id":43194,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/29910\/revisions\/43194"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=29910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=29910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=29910"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=29910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}