<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Issue when using API REST in ALFRESCO 6.2 in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/issue-when-using-api-rest-in-alfresco-6-2/m-p/133186#M35881</link>
    <description>&lt;DIV&gt;Hi Community!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;We are experiencing some issues using Alfresco REST API services (from Java).&lt;/DIV&gt;&lt;DIV&gt;We want to use versioning using checkOut and checkIn methods with the Alfresco REST API. In our logic, we use:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;1. &lt;STRONG&gt;Lock&lt;/STRONG&gt; document:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/lockNode" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#/nodes/lockNode&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;2. &lt;STRONG&gt;Update&lt;/STRONG&gt; content and document version:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/updateNodeContent" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#/nodes/updateNodeContent&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;3. &lt;STRONG&gt;Unlock&lt;/STRONG&gt; document:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/unlockNode" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#/nodes/unlockNode&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;The error arises ocasionally when we execute the lock, update and unlock services on the same document, at least, 2 times in a row.&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;These are the responses of the services we are getting on the first lock, update and unlock proces:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;1.Lock response (Status code = 200):&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ...aspectNames":["cm:versionable","cm:lockable","cm:auditable"], ..."properties":{"cm:lockType":"WRITE_LOCK","cm:lockOwner":{"id":"CONSULGDA","displayName":"CONSULGDA not null"},"cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:lockLifetime":"PERSISTENT"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;2.Update response (Status code = 200):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ..."aspectNames":["cm:versionable","cm:lockable","cm:auditable"], ... "properties":{"cm:lockType":"WRITE_LOCK","cm:lockOwner":{"id":"CONSULGDA","displayName":"CONSULGDA not null"},"cm:versionType":"MAJOR","cm:versionLabel":"2.0","cm:lockLifetime":"PERSISTENT"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;3.Unlock response (Status code = 200):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ...aspectNames":["cm:versionable","cm:auditable"], ..."properties":{"cm:versionLabel":"2.0","cm:versionType":"MAJOR"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Then we execute again the Lock, Update and Unlock process on the same document, and we get the following responses:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;1.Lock response (Status code = 200):&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ..."aspectNames":["cm:versionable",&lt;U&gt;"cm:lockable"&lt;/U&gt;,"cm:auditable"], ... "properties":{"cm:lockType":"WRITE_LOCK","cm:lockOwner":{"id":"CONSULGDA","displayName":"CONSULGDA not null"},"cm:versionType":"MAJOR","cm:versionLabel":"2.0","cm:lockLifetime":"PERSISTENT"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;2.Update response (Status code = 200):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ... &lt;U&gt;aspectNames":["cm:versionable","cm:auditable"]&lt;/U&gt;, ..."properties":{"cm:versionLabel":"3.0","cm:versionType":"MAJOR"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;3.Unlock response (Status code = 422):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"error":{"errorKey":"framework.exception.ApiDefault","statusCode":422,"briefSummary":"...&lt;STRONG&gt;Can't unlock node&lt;/STRONG&gt; 15e44d29-0889-46b9-a2ab-22104157fcf0 because it isn't locked"...}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;As you can see, when we try to unlock the document, it says that it is not able to unlock the node, because it isn't already locked.&lt;/DIV&gt;&lt;DIV&gt;We have checked that for any reason some documents are not set as locked, even though the response from the message is that it was blocked correctly.&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Is this an expected behaviour for the document versioning ?&lt;/DIV&gt;&lt;DIV&gt;Did it happen to you when using document versions in REST API ?&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;Do&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you know why documents are not (or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;do&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;not appear) as locked in the second round ?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Any feedback is welcome.&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 03 Mar 2022 12:40:49 GMT</pubDate>
    <dc:creator>Ander</dc:creator>
    <dc:date>2022-03-03T12:40:49Z</dc:date>
    <item>
      <title>Issue when using API REST in ALFRESCO 6.2</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/issue-when-using-api-rest-in-alfresco-6-2/m-p/133186#M35881</link>
      <description>&lt;DIV&gt;Hi Community!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;We are experiencing some issues using Alfresco REST API services (from Java).&lt;/DIV&gt;&lt;DIV&gt;We want to use versioning using checkOut and checkIn methods with the Alfresco REST API. In our logic, we use:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;1. &lt;STRONG&gt;Lock&lt;/STRONG&gt; document:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/lockNode" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#/nodes/lockNode&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;2. &lt;STRONG&gt;Update&lt;/STRONG&gt; content and document version:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/updateNodeContent" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#/nodes/updateNodeContent&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;3. &lt;STRONG&gt;Unlock&lt;/STRONG&gt; document:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/unlockNode" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#/nodes/unlockNode&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;The error arises ocasionally when we execute the lock, update and unlock services on the same document, at least, 2 times in a row.&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;These are the responses of the services we are getting on the first lock, update and unlock proces:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;1.Lock response (Status code = 200):&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ...aspectNames":["cm:versionable","cm:lockable","cm:auditable"], ..."properties":{"cm:lockType":"WRITE_LOCK","cm:lockOwner":{"id":"CONSULGDA","displayName":"CONSULGDA not null"},"cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:lockLifetime":"PERSISTENT"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;2.Update response (Status code = 200):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ..."aspectNames":["cm:versionable","cm:lockable","cm:auditable"], ... "properties":{"cm:lockType":"WRITE_LOCK","cm:lockOwner":{"id":"CONSULGDA","displayName":"CONSULGDA not null"},"cm:versionType":"MAJOR","cm:versionLabel":"2.0","cm:lockLifetime":"PERSISTENT"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;3.Unlock response (Status code = 200):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ...aspectNames":["cm:versionable","cm:auditable"], ..."properties":{"cm:versionLabel":"2.0","cm:versionType":"MAJOR"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Then we execute again the Lock, Update and Unlock process on the same document, and we get the following responses:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;1.Lock response (Status code = 200):&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ..."aspectNames":["cm:versionable",&lt;U&gt;"cm:lockable"&lt;/U&gt;,"cm:auditable"], ... "properties":{"cm:lockType":"WRITE_LOCK","cm:lockOwner":{"id":"CONSULGDA","displayName":"CONSULGDA not null"},"cm:versionType":"MAJOR","cm:versionLabel":"2.0","cm:lockLifetime":"PERSISTENT"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;2.Update response (Status code = 200):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;EM&gt;{"entry":{"isFile":true, ... &lt;U&gt;aspectNames":["cm:versionable","cm:auditable"]&lt;/U&gt;, ..."properties":{"cm:versionLabel":"3.0","cm:versionType":"MAJOR"}}}&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;3.Unlock response (Status code = 422):&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;{"error":{"errorKey":"framework.exception.ApiDefault","statusCode":422,"briefSummary":"...&lt;STRONG&gt;Can't unlock node&lt;/STRONG&gt; 15e44d29-0889-46b9-a2ab-22104157fcf0 because it isn't locked"...}}&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;As you can see, when we try to unlock the document, it says that it is not able to unlock the node, because it isn't already locked.&lt;/DIV&gt;&lt;DIV&gt;We have checked that for any reason some documents are not set as locked, even though the response from the message is that it was blocked correctly.&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Is this an expected behaviour for the document versioning ?&lt;/DIV&gt;&lt;DIV&gt;Did it happen to you when using document versions in REST API ?&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;Do&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you know why documents are not (or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;do&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;not appear) as locked in the second round ?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Any feedback is welcome.&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Mar 2022 12:40:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/issue-when-using-api-rest-in-alfresco-6-2/m-p/133186#M35881</guid>
      <dc:creator>Ander</dc:creator>
      <dc:date>2022-03-03T12:40:49Z</dc:date>
    </item>
  </channel>
</rss>

