Follow Content Item Relations

This section shows how a content item's relations are included in Atom entry resources, and how you can navigate from a content item to it's related content items.

If a retrieved content item has related content items, then they are always included in the returned Atom entry resource. They appear as link elements, with the rel attribute set to related. The following example shows the Atom entry resource for a content item with two related content items (highlighted in bold):

<entry xmlns="http://www.w3.org/2005/Atom"xmlns:vdf="http://www.vizrt.com/types"
       xmlns:ns2="http://www.w3.org/1999/xhtml" xmlns:ns="http://www.w3.org/2005/Atom"
       xmlns:metadata="http://xmlns.escenic.com/2010/atom-metadata" xmlns:dcterms="http://purl.org/dc/terms/"
       xmlns:app="http://www.w3.org/2007/app">
  <id>http://host-ip-address/webservice/escenic/content/5403</id>
  <title type="text">UK and US terror alerts</title>
  <updated>2010-10-03T22:07:41.000Z</updated>
  <app:edited>2011-01-14T14:24:16.000Z</app:edited>
  <published>2010-10-03T22:07:41.000Z</published>
  <dcterms:created>2010-10-03T22:07:41.000Z</dcterms:created>
  <author>
    <name>Mark mark</name>
    <uri>http://host-ip-address/webservice/escenic/person/103</uri>
  </author>
  <dcterms:identifier>5403</dcterms:identifier>
  <metadata:reference source="ece-auto-gen"
                      sourceid="38f4f7a2-c2bb-4026-a79f-3bde3c3592df" />
  <link href="http://host-ip-address/webservice/escenic/section/44"
        rel="http://www.vizrt.com/types/relation/home-section" title="News"
        type="application/atom+xml; type=entry" />
  <link href="http://ecedemo5/wf-escenic-times/news/article5403.ece"
        rel="alternate" />
  <link href="http://host-ip-address/webservice/escenic/publication/wf-escenic-times"
        rel="http://www.vizrt.com/types/relation/publication"
        title="wf-escenic-times" type="application/atom+xml; type=entry" />
  <metadata:creator>
    <name>Mark mark</name>
  </metadata:creator>
  <metadata:publication href="http://host-ip-address/webservice/escenic/publication/wf-escenic-times">
    <link href="http://host-ip-address/webservice/escenic/section/44"
          rel="http://www.vizrt.com/types/relation/home-section" title="News"
          type="application/atom+xml; type=entry" />

    <link href="http://host-ip-address/webservice/escenic/section/44"
          rel="http://www.vizrt.com/types/relation/section" title="News"
          type="application/atom+xml; type=entry" />
  </metadata:publication>
  <link href="http://host-ip-address/webservice/escenic/content/5403" rel="edit" />
  <link href="http://host-ip-address/webservice/escenic/content/5403" rel="self" />
  <link href="http://host-ip-address/webservice/escenic/lock/article/5403"
        rel="http://www.vizrt.com/types/relation/lock" />
  <content type="application/vnd.vizrt.payload+xml">
    <vdf:payload model="http://host-ip-address/webservice/escenic/model/news">
      ...content...
    </vdf:payload>
  </content>
  <link href="http://host-ip-address/webservice/escenic/content/1513"
        rel="related" type="application/atom+xml; type=entry"
        metadata:group="STORYREL">
    <vdf:payload model="http://host-ip-address/webservice/content-summaries/news">
      <vdf:field name="TITLE">
        <vdf:value>Obama rejects 'Biden option' on Afghanistan</vdf:value>
      </vdf:field>
      <vdf:field name="LEADTEXT">
        <vdf:value>President Obama ....</vdf:value>
      </vdf:field>
    </vdf:payload>
  </link>
  <link href="http://host-ip-address/webservice/escenic/content/5391"
        rel="related" type="application/atom+xml; type=entry"
        metadata:group="STORYREL">
    <vdf:payload model="http://host-ip-address/webservice/content-summaries/news">
      <vdf:field name="TITLE">
        <vdf:value>Travel alert issued for U.S. citizens in Europe</vdf:value>
      </vdf:field>

      <vdf:field name="LEADTEXT">
        <vdf:value>The United States ...</vdf:value>
      </vdf:field>
    </vdf:payload>
  </link>
</entry>

The rel="related" attribute setting indicates that the link represents one of the content item's relations. The metadata:group attribute specifies the relation type group that the relation belongs to. Relation type groups are defined in the content-type publication resource (see relation-type-group) and appear as separate relation drop zones in Content Studio.

Note that each relation link element also contains the relation's summary fields packaged in a VDF payload element. This makes it possible for interactive clients to display the relation summaries along with a content item, in the same way as Content Studio.

A client can retrieve related content items by following the links, for example:

curl -u user:password -X GET http://host-ip-address/webservice/escenic/content/1513