<?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: Can&amp;apos;t get relations using automation REST api in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313983#M984</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;did you find an answer? I encounter a similar issue.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sat, 26 Oct 2013 14:25:15 GMT</pubDate>
    <dc:creator>Artmoni_Mobile</dc:creator>
    <dc:date>2013-10-26T14:25:15Z</dc:date>
    <item>
      <title>Can&amp;apos;t get relations using automation REST api</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313982#M983</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm using Nuxeo 5.6. I try to use REST api to get related documents. I use operation Relations.GetRelations with parameters:
predicate = References
outgoing = true
and input:
doc:344fad4a-99bf-45b2-85fc-63c45e48093d.&lt;/P&gt;
&lt;P&gt;Operation returns empty list of documents although document with this uid has outgoing reference with predicate References. I tried some other operations and they worked so I know how to create correct request. Did someone have similar issue? Does operation Relations.GetRelations work correctly? There is also one additional parameter graphName, what is it's purpose?&lt;/P&gt;
&lt;P&gt;Thanks for help.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2012 15:53:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313982#M983</guid>
      <dc:creator>Chris_</dc:creator>
      <dc:date>2012-12-07T15:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can&amp;apos;t get relations using automation REST api</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313983#M984</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;did you find an answer? I encounter a similar issue.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2013 14:25:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313983#M984</guid>
      <dc:creator>Artmoni_Mobile</dc:creator>
      <dc:date>2013-10-26T14:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can&amp;apos;t get relations using automation REST api</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313984#M985</link>
      <description>&lt;P&gt;I know this answer is a year late, but I just learned how to do this in 5.8 LTS.  The trick is to understand what valid "predicate" values are, e.g. I had to use a DOM inspector on the DM UI to realize that they are actually URIs, here are valid values:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://purl.org/dc/terms/ConformsTo" target="test_blank"&gt;http://purl.org/dc/terms/ConformsTo&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://purl.org/dc/terms/IsBasedOn" target="test_blank"&gt;http://purl.org/dc/terms/IsBasedOn&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://purl.org/dc/terms/References" target="test_blank"&gt;http://purl.org/dc/terms/References&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://purl.org/dc/terms/Replaces" target="test_blank"&gt;http://purl.org/dc/terms/Replaces&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://purl.org/dc/terms/Requires" target="test_blank"&gt;http://purl.org/dc/terms/Requires&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;So, to query the relations of a document with the API, do the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;request method POST&lt;/LI&gt;
&lt;LI&gt;URL path /nuxeo/api/v1/automation/Relations.GetRelations&lt;/LI&gt;
&lt;LI&gt;request header "Accept: application/json+nxentity,&lt;EM&gt;/&lt;/EM&gt;"&lt;/LI&gt;
&lt;LI&gt;request header "Content-Type: application/json+nxrequest"&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Your request body should be like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;{
 "input":"/default-domain/workspaces/mydoc",
 "context":{},
 "params":{
    "predicate":"http://purl.org/dc/terms/References",
    "outgoing":false
  }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;input JSON parameter identifies the relations for&lt;/LI&gt;
&lt;LI&gt;params.predicate is one of the URIs from above&lt;/LI&gt;
&lt;LI&gt;params.outgoing:   true=return outgoing relations from this document, false=return incoming relations to this document&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;hope that helps!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 17:16:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-apos-t-get-relations-using-automation-rest-api/m-p/313984#M985</guid>
      <dc:creator>russtrotter_</dc:creator>
      <dc:date>2013-11-14T17:16:07Z</dc:date>
    </item>
  </channel>
</rss>

