Configure the Types of a service
Each service may include one or more content types. You cannot add one and the same type twice in a service.
Select the types included in the service
Under This service provides access to..., you can configure which content types are included in the service and which of their fields are exposed.
NOTE: In case the content type uses Related media custom fields, make sure the respective media - Images, Documents, or Videos are enabled on the Web service module. Otherwise, the custom fields are not displayed.
IMPORTANT: Excluding a type from the service will affect the return of webhooks. For example, if you exclude the images type from the default webservice, the web hook for images will return an empty item.
By leaving all types selected, you are setting the AutoGeneration
property of the service to true
. It controls how the types to the service are added. If it is set to true
, the types of the service will be automatically populated from out-of-the-box Sitefinity CMS recommended types and their properties.
This means that every newly added or removed custom field or dynamic type will be automatically added or removed from this collection. The changes to the configuration are reflected immediately after a save action occurs. An exception is the navigation property for comments, whose AutoGeneration
mode depends on the configuration in the Comments module. A change to the comments settings require an application restart.
You can turn off auto-generation from the Advanced configuration of types.
To configure the types that are exposed by the service, select the types included in the service by performing the following:
- Under This service provides access to..., click Change.
A list of all supported content types appears.
- Select the content types that you want to be included in the service.
NOTE: When excluding some types, you can decide whether to set the AutoGeneration
property to false. This means when a new type is created, it will not be automatically reflected in the service. You have to manually maintain the collection of types.
-
To do this, deselect Automatically select newly created content types checkbox.
- Click Done.
Change the URL of a type
If you want to change the auto-generated URL of the type, click the URL of the type and enter the new one.
This way, you set the UrlName
property of the type, which is the third segment in the URL that is used to build up the full URL. This property is unique per service.
Select the fields that each type exposes
After you choose which type to include in the service, for each selected type, you can configure which fields you want to include and what properties each field would have, such as sorting or filtering.
Perform the following:
- At the bottom of This service provides access to..., click Advanced.
- In column FIELDS, click All link of the type that you want to configure.
The fields of the content type appear.
- Select the fields that you want to include.
- For each selected field, choose whether you want to allow filtering or sorting, or both.
NOTE: When excluding some types, you can decide whether to set the AutoGeneration
property to false. This means when a the fields of a type change, this will not be automatically reflected in the service. You have to manually maintain the collection of types and their fields.
- To do this, deselect Automatically select newly created fields checkbox.
- Click Done.
NOTE: Some fields are non-editable fields and can only be set on insert and not update. This is required as there are properties like the UrlName of a library, which upon change requires the recalculation of the URLs of all the images, videos, and documents below it. As such operations are resource consuming, the values of such properties cannot be updated with a simple update request. These properties include UrlName of image, video, and document libraries.
Change the access permissions of a type
If you want to set individual access level for a content type that is different that the access level, you set for the entire web service, click Advanced.
In the ACCESS dropdown box, select the desired access level for each individual content type.