Previous Page Arrow Next Page Arrow

3.1 Typical Feed

Let’s start with a simple query on the salesOrders resource:

GET /sdata/myApp/myContract/-/salesOrders

This query returns the following feed:

<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns:sdata="http://schemas.sage.com/sdata/2008/1" 
      xmlns:http="http://schemas.sage.com/sdata/http/2008/1" 
      xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
      xmlns:sle="http://www.microsoft.com/schemas/rss/core/2005" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://www.w3.org/2005/Atom">

  <!-- Atom feed elements -->
  <title>Sage App | Sales Orders</title>
  <id>http://www.example.com/sdata/myApp/myContract/-/salesOrders</id>
  <updated>2008-03-31T13:46:45Z</updated>
  <author>
    <name>myApp</name>
  </author>

  <!-- Feed level links -->
  <link rel="self" type="application/atom+xml; type=feed" title="Refresh" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders" />
  <link rel="first" type="application/atom+xml; type=feed" title="First Page" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders?startIndex=1&amp;count=10" />
  <link rel="last" type="application/atom+xml; type=feed" title="Last Page" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders?startIndex=31461&amp;count=10" />
  <link rel="next" type="application/atom+xml; type=feed" title="Next Page" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders?startIndex=11&amp;count=10" />
  <link rel="http://schemas.sage.com/sdata/link-relations/schema" 
        type="application/xml" title="Schema" 
        href="http://www.example/sdata/myApp/myContract/-/salesOrders/$schema?version=5" />
  <link rel="http://schemas.sage.com/sdata/link-relations/template" 
        type="application/atom+xml; type=entry" title="Template" 
        href="http://www.example/sdata/myApp/myContract/-/salesOrders/$template" />
  <link rel="http://schemas.sage.com/sdata/link-relations/post" 
        type="application/atom+xml; type=entry" title="Post" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders" />
  <link rel="http://schemas.sage.com/sdata/link-relations/service" 
        type="application/atom+xml; type=feed" title="Service" 
        href="http://www.example.com/sdata/myApp/myContract/-/salesOrders/$service" />

  <!-- Categories -->
  <category scheme="http://schemas.sage.com/sdata/categories" 
            term="collection" label="Resource Collection"/>

  <!-- Paging information -->
  <opensearch:totalResults>31465</opensearch:totalResults>
  <opensearch:startIndex>1</opensearch:startIndex>
  <opensearch:itemsPerPage>10</opensearch:itemsPerPage>

  <!-- Simple List Extensions -->
  <sle:treatAs>list</sle:treatAs>
  <sle:listinfo>
    <sle:sort label="ID" default="true" />
    <sle:sort ns="http://schemas.sage.com/myContract" 
      element="salesOrder/orderDate" label="Date" data-type="date" />
    <sle:sort ns="http://schemas.sage.com/myContract" 
      element="salesOrder/shipDate" label="Shipping Date" data-type="date" />
    <sle:group ns="http://schemas.sage.com/myContract" 
      element="salesOrder/contactID" label="Contact" />
  </sle:listinfo> 

  <!-- Atom entry -->
  <entry>
    <id>http://www.example.com/sdata/myApp/myContract/-/salesOrders('43660')</id>
    <title>Sales Order 43660</title>
    <updated>2008-03-31T13:46:45Z</updated>
    <link rel="self" type="application/atom+xml; type=entry" title="self" 
          href="http://www.example.com/sdata/myApp/myContract/-/salesOrders('43660')" />
    <category scheme="http://schemas.sage.com/sdata/categories" 
              term="resource" label="Resource"/>
    <content>Sales order 43660: amount 1553,1035</content>
    <!-- Resource payload -->
    <sdata:payload>
      <salesOrder sdata:key="43660" xmlns="http://schemas.sage.com/myContract">
        <orderDate>2001-07-01</orderDate>
        <shipDate xsi:nil="true" />
        <contact sdata:key="216" 
                 sdata:url="http://www.example.com/sdata/myApp/myContract/-/contacts('216')" 
                 sdata:lookup="http://www.example.com/sdata/myApp/myContract/-/contacts"/>
        <orderLines sdata:url="http://www.example.com/sdata/myApp/myContract/-/salesOrderLines?where=salesOrderID%20eq%2043660"/>
        <subTotal>1553.1035</subTotal>
      </salesOrder>
    </sdata:payload>
    <http:etag>gJaGtgHyuAwW6jMI4i0njA==</http:etag>
  </entry>

  <!-- Atom entry -->
  <entry>
    <id>http://www.example.com/sdata/myApp/myContract/-/salesOrders('43661')</id>
    <title>Sales Order 43661</title>
    <updated>2008-03-31T13:46:45Z</updated>
    <link rel="self" type="application/atom+xml; type=entry" title="self" 
          href="http://www.example.com/sdata/myApp/myContract/-/salesOrders('43661')" />
    <category scheme="http://schemas.sage.com/sdata/categories" 
              term="resource" label="Resource"/>
    <content>Sales order 43661: amount 39422,1198</content>
    <!-- Resource payload -->
    <sdata:payload>
      <salesOrder sdata:key="43661" xmlns="http://schemas.sage.com/myContract">
        <orderDate>2001-07-01</orderDate>
        <shipDate xsi:nil="true" />
        <contact sdata:key="281" 
                 sdata:url="http://www.example.com/sdata/myApp/myContract/-/contacts('281')" 
                 sdata:lookup="http://www.example.com/sdata/myApp/myContract/-/contacts" />
        <orderLines sdata:url="http://www.example.com/sdata/myApp/myContract/-/salesOrderLines?where=salesOrderID%20eq%2043661"/>
        <subTotal>39422.1198</subTotal>
      </salesOrder>
    </sdata:payload>
    <http:etag>3nqPeQqoGoxQB5xf3NIijw==</http:etag>
  </entry>

  <!-- ... 8 more entries ... -->
</feed>

Previous Page Arrow Next Page Arrow