<?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 How to retrieve content via REST in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-content-via-rest/m-p/300548#M253678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to retrieve some content via REST but specifying a particular version, or other data&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can get the content&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This returns exactly what I want (the content of 'fragment.html'), but I'd like to be able to specify a particular version (or other such metadata), for example return version 1.0 of file or version 1.1 of the file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see there's another way of doing this&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisaction=query&amp;amp;statement=select" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisaction=query&amp;amp;statement=select&lt;/A&gt;&lt;SPAN&gt; * from cmis:document&amp;nbsp; where cmis:name='fragment.html'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but it return only the metadata of file 'fragment.html', not the content, and i can't include cmis:versionLabel in the where clause&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2016 20:08:12 GMT</pubDate>
    <dc:creator>matthew_walters</dc:creator>
    <dc:date>2016-06-10T20:08:12Z</dc:date>
    <item>
      <title>How to retrieve content via REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-content-via-rest/m-p/300548#M253678</link>
      <description>I'd like to retrieve some content via REST but specifying a particular version, or other dataI can get the contenthttp://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.htmlThis returns exactly what I want (the content of 'fragment.html'), but I'd like</description>
      <pubDate>Fri, 10 Jun 2016 20:08:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-content-via-rest/m-p/300548#M253678</guid>
      <dc:creator>matthew_walters</dc:creator>
      <dc:date>2016-06-10T20:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve content via REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-content-via-rest/m-p/300549#M253679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What you're using is CMIS, version 1.1, browser binding. So you can look at the CMIS specification to learn more about what's possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a hint, though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you go to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html&lt;/A&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are asking for the content of an object. It's the same thing you'd get if you were to append "?cmisselector=content" to the end of the URL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you were instead to go to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html?cmisselector=object" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html?cmisselector=object&lt;/A&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would see the object's metadata. That metadata includes a property called cmis:versionLabel, and you've correctly identified that it is not queryable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another cmis selector you might be interested in is "versions". If you go to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html?cmisselector=versions" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html?cmisselector=versions&lt;/A&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will get an array of objects. There's one for every version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So one way to do what you're asking is to run the query to get the objects back, then ask each object for its versions, picking the instance of the specific version you are interested in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's perfectly acceptable to use the raw browser binding like this, but you might find it easier to use a library like OpenCMIS. Then you won't have to dig to figure out what the proper URLs are.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 20:54:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-content-via-rest/m-p/300549#M253679</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2016-06-13T20:54:00Z</dc:date>
    </item>
  </channel>
</rss>

