Web service routes

Sitefinity CMS exposes it's data via OData services. As in the OData flow, Sitefinity CMS allows the registration of one or more routes to handle client requests.

The URL of the web service is composed from the URL of the route and the URL of the service.

EXAMPLE: Each available resource can be found via the following URL convention: <www.yoursite.com>/<RouteUrlName>/<ServiceUrlName>/<TypeUrlName>

Sitefinity CMS has the concept of a default route. The backend UI for service exposure depends on this property, because it allows the management of the services for a single selected route.

By default, Sitefinity CMS has a single route installed under the /api URL. You can change the URL name of the route, if it conflicts with any existing APIs.

IMPORTANT: When making requests to the service include the following header in the request: X-SF-Service-Request: true.
It is needed to successfully call protected services and not receive 401(Unauthorized)

Each route has a UrlName property and a Name property. The UrlName of the route is the first segment in the URL that is used to build up the full URL.

NOTE: UrlName property must be unique and does not allow special characters or multiple segments.

You can change the URL of the service when you create or edit it. You can change the URL of the route in the Advanced setting of the web services module.

To change the name or the URL of the route, perform the following:

  1. Navigate to Administration » Settings » Advanced » WebServices » Routes » Frontend.
  2. In Route name, enter a user friendly name for the route.
  3. In UrlName, enter the new URL of the route.
  4. Click Save changes.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?