Retrieve a content item

GET https://deliver.kontent.ai/:environment_id/items/:item_codename

Retrieve a content item by its codename.

The response size is limited to 2000 items.

Request Params

KeyDatatypeRequiredDescription
languagestringDetermines which language variant of content items to return. By default, the API returns content in the default language.

<div class="callout callout--info">

If the requested content is not available in the specified language variant, the API follows the language fallbacks as configured in the Localization settings.</div>

| | elements | string | | Determines which content elements to retrieve. The elements are specified as a comma-separated list of element codenames. By default, all elements are retrieved.

Examples

  • Retrieve a single element – elements=title
  • Retrieve multiple elements – elements=title,summary,related_articles

Usage notes

  • The filter applies to all content items within the response. That is both the items array and modular_content object property.
  • If the specified elements don't match the elements present in the content items, the API returns the content items without any elements.
  • The filter doesn't apply to content components. For example, if you retrieve only rich text elements, you need complete components used in the rich text to construct the rich text content. | | excludeElements | string | | Determines which content elements to exclude. The elements are specified as a comma-separated list of element codenames. By default, all elements are retrieved.

Examples

  • Exclude a single element – excludeElements=title
  • Exclude multiple elements – excludeElements=title,summary,related_articles

Usage notes

  • The filter applies to all content items within the response. That is both the items array and modular_content object property.

  • If the specified elements don't match the elements present in the content items, the API response returns all elements of the content items without any exclusion.

  • The filter doesn't apply to content components. For example, if you retrieve only rich text elements, you need complete components used in the rich text to construct the rich text content. | | depth | string | | Determines the nesting level for linked content items that the API returns. By default, only the first level of linked items is returned, which is the same as setting depth=1.

  • To include more than one level of linked items in the response, set depth to 2 or more.

  • To exclude all linked items from the response, set depth to 0

<div class="callout callout--info">

Components are always present in response. See Linked content and components for more details.</div>

|

HEADERS

KeyDatatypeRequiredDescription
X-KC-Wait-For-Loading-New-ContentstringDetermines whether the API waits while fetching latest content. By default, the header is not set and the API serves stale content (if cached by the CDN) while fetching the new content to minimize wait time.

The header can be useful if you know that the requested content had changed since your last request in a reaction to a webhook notification. | | Accept | string | | |

RESPONSES

status: OK

{&quot;item&quot;:{&quot;system&quot;:{&quot;id&quot;:&quot;7b11fe14-6282-4daa-b901-e59e231cd93c&quot;,&quot;name&quot;:&quot;How to write error messages&quot;,&quot;codename&quot;:&quot;how_to_error_message&quot;,&quot;language&quot;:&quot;en-US&quot;,&quot;type&quot;:&quot;article&quot;,&quot;collection&quot;:&quot;default&quot;,&quot;sitemap_locations&quot;:[],&quot;last_modified&quot;:&quot;2020-12-16T15:08:53.2391808Z&quot;,&quot;workflow&quot;:&quot;default&quot;,&quot;workflow_step&quot;:&quot;published&quot;},&quot;elements&quot;:{&quot;title&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;name&quot;:&quot;Title&quot;,&quot;value&quot;:&quot;Writing good error messages&quot;},&quot;body_copy&quot;:{&quot;type&quot;:&quot;rich_text&quot;,&quot;name&quot;:&quot;Body&quot;,&quot;images&quot;:{},&quot;links&quot;:{},&quot;modular_content&quot;:[&quot;n78ee300e_7a58_0117_819e_529b2294067b&quot;],&quot;value&quot;:&quot;\u003cp\u003eThe 3 most important things when writing error messages\u003c/p\u003e\n\u003col\u003e\n  \u003cli\u003eDon’t abuse alerts for upselling or showing superfluous information. People will stop reading the messages that are actually important.\u003c/li\u003e\n  \u003cli\u003eDon’t just assume people know about the context of a message. They might toggle between apps and see your message days after it happened. Always include enough information for users to make sense of it.\u003c/li\u003e\n  \u003cli\u003eUse a friendly, non-technical, non-threatening tone of voice.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eTL;DR Write actionable error messages that laypeople can understand.*\u003c/strong\u003e\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e*Not sure if they do? Show them to a non-technical person and ask them to explain it back to you.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eRead the full story on \u003c/em\u003e\u003ca href=\&quot;https://medium.com/@thomasfuchs/how-to-write-an-error-message-883718173322\&quot; data-new-window=\&quot;true\&quot; title=\&quot;How to write a great error message\&quot; target=\&quot;_blank\&quot; rel=\&quot;noopener noreferrer\&quot;\u003e\u003cem\u003eMedium\u003c/em\u003e\u003c/a\u003e\u003cem\u003e.\u003c/em\u003e\u003c/p\u003e\n\u003cobject type=\&quot;application/kenticocloud\&quot; data-type=\&quot;item\&quot; data-rel=\&quot;component\&quot; data-codename=\&quot;n78ee300e_7a58_0117_819e_529b2294067b\&quot;\u003e\u003c/object\u003e&quot;},&quot;author&quot;:{&quot;type&quot;:&quot;modular_content&quot;,&quot;name&quot;:&quot;Author&quot;,&quot;value&quot;:[&quot;jenny_brown&quot;]},&quot;url&quot;:{&quot;type&quot;:&quot;url_slug&quot;,&quot;name&quot;:&quot;URL pattern&quot;,&quot;value&quot;:&quot;writing-good-error-messages&quot;}}},&quot;modular_content&quot;:{&quot;jenny_brown&quot;:{&quot;system&quot;:{&quot;id&quot;:&quot;59838cfd-ba15-4607-8e6a-d91931fc7ce6&quot;,&quot;name&quot;:&quot;Jenny Brown&quot;,&quot;codename&quot;:&quot;jenny_brown&quot;,&quot;language&quot;:&quot;en-US&quot;,&quot;type&quot;:&quot;author&quot;,&quot;sitemap_locations&quot;:[],&quot;last_modified&quot;:&quot;2020-02-05T11:33:54.5271987Z&quot;,&quot;collection&quot;:&quot;default&quot;,&quot;workflow&quot;:&quot;default&quot;,&quot;workflow_step&quot;:&quot;published&quot;},&quot;elements&quot;:{&quot;name&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;name&quot;:&quot;Name&quot;,&quot;value&quot;:&quot;Jenny Brown&quot;},&quot;bio&quot;:{&quot;type&quot;:&quot;rich_text&quot;,&quot;name&quot;:&quot;Bio&quot;,&quot;images&quot;:{},&quot;links&quot;:{},&quot;modular_content&quot;:[],&quot;value&quot;:&quot;\u003cp\u003eJenny is here for all things wildlife and, newly, climate changes.\u003c/p\u003e&quot;}}},&quot;n78ee300e_7a58_0117_819e_529b2294067b&quot;:{&quot;system&quot;:{&quot;id&quot;:&quot;78ee300e-7a58-0117-819e-529b2294067b&quot;,&quot;name&quot;:&quot;78ee300e-7a58-0117-819e-529b2294067b&quot;,&quot;codename&quot;:&quot;n78ee300e_7a58_0117_819e_529b2294067b&quot;,&quot;language&quot;:&quot;en-US&quot;,&quot;type&quot;:&quot;blockquote&quot;,&quot;collection&quot;:&quot;default&quot;,&quot;sitemap_locations&quot;:[],&quot;last_modified&quot;:&quot;2020-12-16T15:08:53.2391808Z&quot;},&quot;elements&quot;:{&quot;quote&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;name&quot;:&quot;Quote&quot;,&quot;value&quot;:&quot;Don&#39;t quote me on this.&quot;},&quot;source&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;name&quot;:&quot;Source&quot;,&quot;value&quot;:&quot;Jeff Loomis&quot;}}}}}