Related Content
Web Content Management

Consuming digital content via the OData API

Posted by Russ Huntington on September 5, 2012
0 people like this tutorial

You can consume data from any digital content list with OData in a few simple steps. Note that to consume this data your website must be running .NET 4.0, or .NET 3.5 SP1 with the Data Services update

  1. On the content list, go to the Developer tab and select the checkbox to “Enable OData API Access”.

  2. Ensure that you have a file in the root of your website solution called AgilityAPI.svc (this is available within Agility CMS > Settings > Developer Downloads).
  3. You can then access a list of the content using this URL format (where “BlogPosts” is the Reference Name of your content definition):

  4. Alternatively, you can request the results in JSON format with an additional parameter:$format=Json

  5. Filter the list using standard OData syntax:

    •$filter=indexof(TextBlob,'Lorem ipsum') eq 0
    •$filter=month(Date) eq 11 and year(Date) eq 2011
    • etc.
  6. Access an individual item using the following format (where 281 is the Content ID of the content item that you want to access):

Add a Comment



Log in with your Agility username and password or
register for the site

Log In