IMPORTANT MESSAGE: We are still experiencing some difficulties that will affect your ability work with the RWS AppStore. Our IT team is working to resolve this but for now you may not be able to download or upload apps through the RWS AppStore. We apologise for the inconvenience and will update the community when we have a resolution in place. In the meantime you can take advantage of the Private AppStore if you are using Trados Studio 2021 or 2022.

Introducing Tridion Sites REST API

As part of the Tridion Sites 9.6 release, we introduce Core Service.REST as a public API for use with Content Manager.

Core Service.REST is a RESTful web service that is the preferred API for interacting with Content Manager. Core Service.REST is used by the Experience Space user interface and it provides native support for Translation Manager and External Content Library.

History moment for reasoning why REST API was born.

First of all WCF technology is not going to be actively supported for .NET Core, and .NET Full Framework 4.8 is the last one

So we needed to start thinking about migration to .NET Core.

Another reason is a plan to revamp Tridion Sites UI with a more modern, web-friendly API and REST API is a golden standard here.

This marriage introduced Tridion Sites REST API to the world and @Vladyslav Antoneko was a happy (or not J) babysitter.

We also should say thank you to @Raimond Kempees and @Likhan Siddiquee that at the current stage are active community members.

Core Service.REST provides many benefits over the WCF-based Core Service, including the following:

  • Native support for Translation Manager and External Content Library makes it unnecessary to use separate APIs for these features
  • Easy to use with support for:
    • HATEOAS links
    • JSON-based models
  • Support for cross-platform applications
  • Aligned list of item properties across all lists
  • Authentication through Tridion Access Management (preferred) or Windows

Probably the main question you would like to ask is how mature is that to start using.

There is no full API parity with WCF Core Service. Although take a look at Experience Space UI to get the complexity of the application you can build using a new API. Also taking into account that unlike Content Manager Explorer, which has its server-side business logic since not all data can be provided by WCF Core Service in the required format, new Experience Space gets all required data through REST API.

 

API coverage by area

A dropped category is related to methods that were related to legacy, like XML support.

Additionally, you can take a look at REST API coverage by following available online resource https://developers.rws.com/TridionSitesSwaggerUi/

As well there you can download specification file to generate your client https://developers.rws.com/TridionSitesSwaggerUi/openapi.json

 

REST API Client

The swagger spec is our default public documentation. Download it, pick the client generation tool, and generate the client.

Escaped URL paths for item URIs

When using item URIs as part of a URL, Core Service.REST requires that you escape the colon by replacing it with an underscore. For example, tcm:0-1-1 becomes tcm_0-1-1. This is to prevent ASP.NET validation from falsely evaluating the URLs as insecure.

Content Manager uses a single URI (Uniform Resource Identifiers) for each identifiable Content Manager object. This format presents a challenge to the Core Service.REST API wherever you want to include the URI as part of a URL path. URIs that are part of a URL path are called escaped URI in the Swagger definition, and you should use an escaped form of the URI there.

You can integrate the following code snippet into your client to transform unescaped URIs into escaped ones:

internal static class TcmUtils
{
  internal static string EscapeUri(this string tcmUri)
    => string.IsNullOrEmpty(tcmUri) ? tcmUri : tcmUri.Replace(":", "_");
}

Although we are working on the possibility to re-introduce the colon symbol back to URI in future versions.

New Tridion Sites REST API can power your cross-platform application. As an example take a look at the example of building a mobile app by @Oleksii Shapovalov that was not possible to implement previously with WCF Core Service.