Entry

View as Markdown

Entry

Retrieves assets

NameTypeDescription
entry_params dictionary

 

Read-only property to get the data of the entry.

content_type_id string
entry_uid string
base_url string

fetch

Fetches the latest version of the entries from stack

import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);

content_type = stack.content_type('content_type_uid')

entry = content_type.entry(uid='entry_uid')

response = entry.fetch()

include_embedded_items

include_embedded_items instance of Entry include_embedded_objects (Entries and Assets) along with entry/entries details

import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);

content_type = stack.content_type('content_type_uid')

entry = content_type.entry(uid='entry_uid')

entry.include_embedded_items()

include_branch

Retrieve the published pranch in the entry response

import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);

content_type = stack.content_type('content_type_uid')

entry = content_type.entry(uid='entry_uid')

entry.include_branch()

include_fallback

Retrieve the published content of the fallback locale if an entry is not localized in specified locale

import contentstack;
stack = contentstack.Stack(api_key, delivery_token, environment);
content_type = stack.content_type('content_type_uid')
entry = content_type.entry(uid='entry_uid')
entry.include_fallback()

include_metadata

Includes entry metadata along with response body.

import contentstack

stack = contentstack.Stack('api_key','delivery_token','environment')

content_type = stack.content_type('contenttype_uid').

result = content_type.entry('entry_uid').include_metadata().find()

print(result)

param

This method is useful to add additional Query parameters to the entry

import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);

content_type = stack.content_type('content_type_uid')

entry = content_type.entry(uid='entry_uid')

entry.param("key", "value")

version

When no version is specified, it returns the latest version, To retrieve a specific version, specify the version number under this parameter. In such a case, DO NOT specify any environment

import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);

content_type = stack.content_type('content_type_uid')

entry = content_type.entry(uid='entry_uid')

entry.version(number)

environment

Enter the name of the environment of which the entries needs to be included

import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);

content_type = stack.content_type('content_type_uid')

entry = content_type.entry(uid='entry_uid')

entry.environment('environment_name')