Unveiling Umbraco CMS: A Developer’s Guide to Content Delivery API (Part 2)

Dhanesh Kumar MJ
3 min readNov 24, 2023

--

Welcome to the part 2 of the Umbraco CMS Content Delivery API, In this article, we can learn more about the Content Delivery API.

Exploring Umbraco’s Content Delivery API. In this segment, we dive deeper into the Umbraco Content Delivery API, understanding its role in content and media consumption. We’ll explore the various query parameters, authentication methods, limitations, and more that shape its functionality.

This article follows the initial installment, “Unveiling Umbraco: A Developer’s Guide to Content Delivery API (Part 1),” where we covered the installation and configuration of Umbraco 12 as a Headless CMS alongside its traditional CMS features. If you missed it, consider revisiting Part 1 for foundational insights.

Navigating Swagger Documentation

Accessing the Swagger documentation via the URL path /umbraco/swagger/index.html?urls.primaryName=Umbraco%20Delivery%20API provides a comprehensive view of Umbraco’s Content and Media APIs. These APIs serve distinct purposes, one catering to Umbraco’s content retrieval and the other focused on managing media assets.

Content API Overview

The Content API primarily operates in a read-only mode, offering no CRUD (Create, Read, Update, Delete) capabilities. Its function revolves around fetching Umbraco content exclusively. This API allows developers to access and retrieve content from Umbraco efficiently.

Authentication ?

Authentication for accessing Umbraco content via the Delivery API is optional by default. To restrict API content access, enabling authentication is necessary by configuring the appsettings.json file:

"Umbraco": {
"CMS": {
"DeliveryApi": {
"Enabled": true,
"ApiKey": "Your_API_Key_Here",
"PublicAccess": false
}
}
}

Methods (HTTP Verbs) ?

Currently the Umbraco Content and Media APIs supports only read operations (GET methods), limiting their functionality to fetching content and media items.

Multi-Lingual Support?

Yes, The API extends support for multi-lingual content retrieval through a language/culture query parameter.

Pagination?

Yes, Achieve pagination with Skip (Page Number) and Take (Page Size) query parameters for efficient content retrieval.

Saved/Draft Content Retrieval ?

Yes, Utilize the Preview query parameter to fetch saved or draft content items.

Content Selection Options (Fetch Content):

Customize content retrieval by specifying structure-based queries using the selector option. Built-in selectors include fetching ancestors, children, and descendants based on a content item’s GUID(key) or path.

Filtering Content:

The filter query parameter allows specifying content type or content item name filters. Additionally, negation (!) supports exclusion from result sets based on specified filter criteria.

Expanding Content Properties:

Enhance content retrieval by expanding referenced item properties through the expand query option. This feature provides detailed information about referenced items within a content.

Sorting Content:

Employ the sort query option to order content retrieval based on fields like creation date, level, name, sort order, and update date in ascending (asc) or descending (desc) order.

Extending Query Parameter Options in Umbraco

In order to align with specific business requirements, customizing the default query parameters — fetch, filter, expand, and sort — becomes essential. Umbraco offers extensive flexibility in extending these functionalities to meet diverse needs.

What’s Next?

The next part will delve deeper into leveraging Umbraco’s flexibility to modify and extend the behavior of query parameters. We’ll explore how these modifications cater to unique business requirements, discussing considerations, awareness, and existing limitations.

Umbraco 12 Headless Sample project here — https://github.com/dKumarmj/Umbraco12HeadlessDemo

Join friendly community to know more about Umbraco — https://www.meetup.com/kerala-umbraco-community/events/

Conclusion

This segment provided a comprehensive view of Umbraco’s Content Delivery API. We explored its fundamental functionalities, including content retrieval, authentication, Http verbs, and query parameters.

In the next part we can see how we can extend and customize query parameters to meet specific business needs.

--

--

Dhanesh Kumar MJ

Engineer @ Phases.io| Traveler | Story Teller | Spiritual Being