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.
ReturnsRelatedItemsResponse.GET /restapi/sitefinity/related-data/parent-items
Gets related parent items for a specific item.
ReturnsRelatingItemsResponse.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, whenRelatedDataFieldis added.
ReturnsList<DataTypeResponse>.PUT /restapi/sitefinity/related-data/relations
Applies changes that are made to item relations in Tempstatus.
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. IfRelatedItemId,RelatedItemType,RelatedItemProvider, andFieldNameare provided, items related to the specified item are marked with a propertyIsRelated=truein the returned response of typeDataItemsResponse.DELETE /restapi/sitefinity/generic-data/temp-items
Deletes all temp items of the provided item.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
Get started with Integration Hub | Sitefinity Cloud
This free lesson teaches administrators, marketers, and other business professionals how to use Sitefinity Integration Hub to create automated workflows between Sitefinity and other business systems.
Web Security for Sitefinity Administrators
This free lesson teaches administrators the basics about protecting your Sitefinity instance and your 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 ASP.NET Core and take advantage of its decoupled architecture and modern development model.