Use REST services with related content items

NOTE: With the introduction of Content as a service API based on OData protocol in Sitefinity CMS 9.0, the OData Web Services are the recommended way to go when consuming Sitefinity  CMS content. The operations described in this article are fully supported by the OData services, for more information see: Related data. If your use case requires sticking to  the ServiceStack services, described below, you can continue doing so, but please keep in mind that unlike the OData services, these services work with objects in status Temp.

You can use two ServiceStack services for the Related data functionality: 

  • RelatedDataService 
    This class represents a service that the Related data functionality uses. The service defines the following endpoints:  
    • GET /restapi/sitefinity/related-data/child-items 
      Gets related child items for a specific item.
      Returns RelatedItemsResponse.
    • GET /restapi/sitefinity/related-data/parent-items 
      Gets related parent items for a specific item.
      Returns RelatingItemsResponse.
    • GET /restapi/sitefinity/related-data/data-types 
      Gets all available data types with available providers, which a relation can be created to. Used in the custom field designer, when RelatedDataField is added.
      Returns List<DataTypeResponse>.
    • PUT /restapi/sitefinity/related-data/relations 
      Applies changes that are made to item relations in Temp status. 
  • GenericDataService 
    This class is used to retrieve a list of data items that can be related to the current item. 
    • GET /restapi/sitefinity/generic-data/data-items 
      Gets list of available items to be related. If RelatedItemId, RelatedItemType, RelatedItemProvider, and FieldName are provided, items related to the specified item are marked with a property IsRelated=true in the returned response of type DataItemsResponse.
    • DELETE /restapi/sitefinity/generic-data/temp-items 
      Deletes all temp items of the provided item.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?