IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
Sitefinity does not support all of the oData query syntax. This is because oData was made to support the Entity Framework LINQ API. Since Sitefinity is using Telerik DataAccess, not every method that is available from the Entity Framework API is available for the DataAcess API.
Following are sample queries that are supported by Sitefinity. The URL /api/default/newsitems is used for demonstration purposes:
/api/default/newsitems
/api/default/newsitems/$count
/api/default/newsitems?$select=Title,UrlName
/api/default/newsitems?$expand=RelatedImages
NOTE: Expand only supports a single level of expansion.
/api/default/newsitems?$filter=
/api/default/newsitems?$skip=10&$top=20
Comments are exposed as complex property to content types which supports comments.
To query comments, use api/default/newsitems(<news_id>)/Comments
api/default/newsitems(<news_id>)/Comments
Two types of taxonomies are exposed – flat and hierarchical.
api/default/taxonomies
TaxaUrl
Id
api/default/<Taxa-Url?$filter=TaxonomyId eq <taxonomy_id>
To query (or filter) items in different cultures, you must add the sf_culture query-string parameter. The valid values for this parameter are any valid .NET culture codes. For example, en, en-US, de, etc.
sf_culture
en
en-US
de
NOTE: By supplying the culture filter, only the live items are filtered based upon their published versions. If you are querying draft items, this does not apply. For example when querying news items like using api/default/newsitems?sf_culture=en, only the items that are translated in the English language will be returned.
api/default/newsitems?sf_culture=en
In order to query items from a different provider then the default one, you should add the sf_provider parameter. For example, api/default/newsitems?sf_provider=OpenAccessDataProvider
sf_provider
api/default/newsitems?sf_provider=OpenAccessDataProvider
For more information, see your custom service documentation available at /api/default/sfhelp
For more information about oData syntax, see oData URL Conventions.
Web services are designed to work outside the context of sites. If you have a site with a subfolder registered in the multisite configuration - for example, localhost/subfolder, the link http://localhost/subfolder/api/default will return a 404 response code, because only pages are designed to be resolved with subfolders.
Instead, to access data from other providers, use the sf_provider and sf_culture query string parameters passed with the URL.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important