<?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 Re: SEARCH API : find by ancestor in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124461#M34022</link>
    <description>&lt;P&gt;Actually, a mistake in the URL ...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found out I used :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://localhost:8080/alfresco/api/-default-/public/search/versions/1//search/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/search/versions/1//search/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;instead of :&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search/&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 02 Sep 2024 13:01:02 GMT</pubDate>
    <dc:creator>JC83</dc:creator>
    <dc:date>2024-09-02T13:01:02Z</dc:date>
    <item>
      <title>SEARCH API : find by ancestor</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124458#M34019</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm facing an issue with APi REST&lt;BR /&gt;I'm just trying to perform a simple search request :&lt;/P&gt;&lt;P&gt;this works perfectly though curl under bash&lt;/P&gt;&lt;P&gt;curl -s -u login&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ass "&lt;A href="http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search" target="_blank" rel="noopener nofollow noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search&lt;/A&gt;" --data '{"query":{"query":"ANCESTOR:\"workspace://SpacesStore/1928ee33-6f85-4543-bd67-3b8b29641946\""}}'&lt;/P&gt;&lt;P&gt;But there is no way to make it works under php&lt;/P&gt;&lt;P&gt;$url = "$SURLBASE/search";&lt;/P&gt;&lt;P&gt;$myquery = array("query" =&amp;gt; 'ANCESTOR:"workspace://SpacesStore/'.$parentfolder.'"'); // AND irfm:status:Approved");&lt;BR /&gt;$processBody = array(&lt;BR /&gt;"query" =&amp;gt; $myquery,&lt;BR /&gt;"paging" =&amp;gt; array(&lt;BR /&gt;"maxItems" =&amp;gt; "500000"&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;$processBody = array("query" =&amp;gt; $myquery);&lt;BR /&gt;$processBodyjson=json_encode($processBody,JSON_UNESCAPED_SLASHES );&lt;BR /&gt;$ch = curl_init($url);&lt;BR /&gt;curl_setopt($ch, CURLOPT_URL, $url);&lt;BR /&gt;//to avoid curl_exec to perform as "echo"&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json;charset=UTF-8"));&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);&lt;BR /&gt;curl_setopt($ch, CURLOPT_POSTFIELDS, $processBodyjson );&lt;BR /&gt;$json = curl_exec($ch);&lt;BR /&gt;$array = json_decode($json, 1);&lt;BR /&gt;curl_close($ch);&lt;BR /&gt;return($array);&lt;/P&gt;&lt;P&gt;The answer is :&lt;/P&gt;&lt;P&gt;Array&lt;BR /&gt;(&lt;BR /&gt;[error] =&amp;gt; Array&lt;BR /&gt;(&lt;BR /&gt;[errorKey] =&amp;gt; framework.exception.NotFound&lt;BR /&gt;[statusCode] =&amp;gt; 404&lt;BR /&gt;[briefSummary] =&amp;gt; 07238988 {0} introuvable&lt;BR /&gt;[stackTrace] =&amp;gt; Pour des raisons de sécurité, le traçage de la pile n'est plus affiché, mais la propriété est conservée dans les versions précédente.&lt;BR /&gt;[descriptionURL] =&amp;gt; &lt;A href="https://api-explorer.alfresco.com" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com&lt;/A&gt;&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;what am i doing wrong ?&lt;BR /&gt;thank you !&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:10:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124458#M34019</guid>
      <dc:creator>JC83</dc:creator>
      <dc:date>2024-08-23T14:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: SEARCH API : find by ancestor</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124459#M34020</link>
      <description>&lt;P&gt;Based on the error message, it suggests that the Alfresco server is not able to locate the resource you're requesting. This typically happens when the request URL or body is incorrect or not properly formatted. Verify that your php code is invoking to the same URL you're testing with curl.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 06:15:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124459#M34020</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2024-08-26T06:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: SEARCH API : find by ancestor</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124460#M34021</link>
      <description>&lt;P&gt;Thanks for the answer&lt;/P&gt;&lt;P&gt;URL in PHP code is a copy/paste one from the bash command line ..&lt;/P&gt;&lt;P&gt;I guess this is a matter of syntax with the slashs .. but .. Is there a way to have a more detailed error (with the received data for example) ??&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 06:26:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124460#M34021</guid>
      <dc:creator>JC83</dc:creator>
      <dc:date>2024-08-26T06:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: SEARCH API : find by ancestor</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124461#M34022</link>
      <description>&lt;P&gt;Actually, a mistake in the URL ...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found out I used :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://localhost:8080/alfresco/api/-default-/public/search/versions/1//search/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/search/versions/1//search/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;instead of :&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search/&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Sep 2024 13:01:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/search-api-find-by-ancestor/m-p/124461#M34022</guid>
      <dc:creator>JC83</dc:creator>
      <dc:date>2024-09-02T13:01:02Z</dc:date>
    </item>
  </channel>
</rss>

