Display content from your own sample project in a few easy steps.This is a great place to start if you’re new to headless CMSs.
Prerequisites
Sign in to your Kontent.ai account, or sign up if you don’t have one yet.After you sign in, you’ll get the Getting Started Project, which you’ll use later.
1. Open your sample project
In Kontent.ai, use the dropdown at the top to select the Getting Started Project.With the project open, you need to find its ID. Then you can make an API call for that project’s content.
2. Find the project’s ID
To retrieve any content, you need to know its ID. In Kontent.ai, your project’s content lives within environments.The Getting Started Project has just a single environment named Production.To find the Production environment’s ID:
In Environment settings, click General.
In the Environment ID card, click .
For example, the environment ID might look like this 5d15cca0-e806-0032-2a8f-2ecef71a50e3.With the environment ID ready, let’s find content to display.
3. Open a published content item
When you go to Content & assets, you see three content items.
🌟Welcome to Kontent.ai – Read Me First🌟
Landing page with product listing
Product
Click the content item named Landing page with product listing to open it.
4. Find the content item’s identifier
To retrieve the content item via API, you need to identify it. Here you’re looking for the item’s codename.To find the item’s codename:
Click the Actions button in the top right.
From the list of actions, select Codename.
Click .
For example, the item’s codename might look like this landing_page_with_product_listing.It’s time to combine the identifiers and get your project's content item.
5. Display the content item
You know how to identify the environment and the content item. With these two identifiers, you can retrieve the content item via Delivery API and display the item’s content.In the interactive example below, there’s a simple HTML page that’s populated by JavaScript.To display the content item from your own Getting Started Project, edit index.ts to use your environment ID (on line 8) and content item codename (on line 13) you got earlier.
Sign in with your Kontent.ai credentials or sign up for free to unlock the full lesson, track your progress, and access exclusive expert insights and tips!
Select the Getting Started Project from your list of projects.
The content item behind the landing page you're going to display.