Entry
Entry
| Name | Type | Description |
|---|---|---|
| uid (required) | String | Returns the value of attribute uid. |
| content_type | String | Returns the value of attribute content_type. |
| fields | Object | Returns the value of attribute fields. |
| query | Object | Returns the value of attribute query. |
get
Get value for field uid
| Name | Type | Description |
|---|---|---|
| field_uids | String | Field uid for which value to be get. |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_reference('category')
.fetch;
@entry.get("field_uid");only
Specifies an array of 'only' keys in BASE object that would be 'included' in the response.
| Name | Type | Description |
|---|---|---|
| fields | Array | Array of the 'only' reference keys to be included in response. |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.only(['title', 'description'])
.fetch;| Name | Type | Description |
|---|---|---|
| fields | String | Reference field uid for which fields to be included |
| fields_with_base | Array | Array of the 'only' reference keys to be included in response. |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.only('category', ['title', 'description'])
.fetch;except
Specifies list of field uids that would be 'excluded' from the response.
| Name | Type | Description |
|---|---|---|
| fields | Array | Array of the 'only' reference keys to be excluded in response. |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.except(['title', 'description'])
.fetch;| Name | Type | Description |
|---|---|---|
| fields | String | Reference field uid for which fields to be excluded |
| fields_with_base | Array | Array of the 'only' reference keys to be excluded in response. |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.except('category', ['title', 'description'])
.fetch;include_content_type
Include object's content_type in response
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_content_type
.fetch;include_reference
Add a constraint that requires a particular reference key details.
| Name | Type | Description |
|---|---|---|
| reference_field_uids | string | Pass reference field that must be included in the response |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_reference('category')
.fetch;| Name | Type | Description |
|---|---|---|
| reference_field_uids | Array | Pass array of reference fields that must be included in the response |
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_reference(['category', 'review'])
.fetch;include_fallback
Include the fallback locale publish content, if specified locale content is not publish.
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_fallback
.fetch;include_branch
Include the branch for publish content.
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_branch
.fetch;include_embedded_items
Include Embedded Objects (Entries and Assets) along with entry/entries details.
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid")
.include_embedded_items
.fetch;fetch
Fetches the latest version of the entries from Contentstack.io content stack
require "contentstack";
@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");
@entry = @stack.content_type("content_type_uid").entry("entry_uid").fetch;