Related Content
Tags
OData API
Web Content Management

Consuming digital content via the OData API

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

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):

    http://domain.com/AgilityAPI.svc/BlogPosts

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

    http://domain.com/AgilityAPI.svc/BlogPosts?$format=Json

  5. Filter the list using standard OData syntax:

    • http://domain.com/AgilityAPI.svc/BlogPosts?$filter=indexof(TextBlob,'Lorem ipsum') eq 0
    • http://domain.com/AgilityAPI.svc/BlogPosts?$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):

    http://domain.com/AgilityAPI.svc/BlogPosts(281)

Add a Comment

   
  
 
 
   
Submit

LOGIN

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




Log In

REGISTER












Register

FORGOT PASSWORD