Querying Umbraco

This is where the API really shines. It can be used to query, segment, filter and page your content in a SQL/LINQ like way using simple name-value pair switches. These name/value pairs should be recognised by the average Umbraco developer, as they are concepts that you use every day when building sites using Razor. Now you can just use them directly via the URL as a set of URL based parameters!

The switches can be applied in any order as part of a simple query-string:

  • children :
    returns all the child nodes of the current node serialised as per the Content-Type

  • descendants :
    returns all the descendant nodes of the current node serialised as per the Content-Type and can also be comma separated to include multiple DocTypes, empty to signify all descendants or a numeric value i.e. 1 to signify the level of descendants to return :
  • where / and / or :
    http://www.mysite.com/anypath?descendants=NewsItem&where=Summary.Contains('News Flash') and Edition lt 20 or Headline eq true
    returns all NewsItems that are descendants of the current node where the Summary property contains the phrase News Flash
    Supported operators include :
    • eq : ==
    • ge : >=
    • gt : >
    • le : <=
    • lt : <
    • ne : !=

  • select :
    returns only the properties specified in the select statement

  • resolvecontent :
    resolves the comma separated nodes stored in the RelatedArticles property and outputs them as part of an Entities array of nodes

  • resolvemedia :
    resolves the media node and replaces the property value with the resolved NiceUrl

  • skip & take :
    use these switches for paging the data server-side

Of course they can all be used together to create really useful data retrieval scenarios eg :

http://www.mysite.com/anypath?descendants=NewsItem&where=Summary.Contains('News Flash')&resolvemedia=PageImage,NewsImage&skip=8&take=4

uHateoas Playground

This is the uHateoas Playground. It is an URL Hypermedia Query Builder that allows you to experiment and discover the data in our demo site, and we have made it available for you to use to build up queries on your site too, if you install the Package. The playground is available on every page of your website by simply adding "/ueditor" to the end of your website url.


Editing Umbraco

The POST , PUT, PATCH and DELETE verbs allow you to do Create Update ...

Learn more