---
title: "Entry"
description: "Entry"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/android/reference/entry"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-13"
---

# Entry

## Entry

An entry is the actual piece of content created using one of the defined content types.

## exceptWithReferenceUid()

The exceptWithReferenceUid method specifies an array of except keys that gets excluded from the response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.<span>exceptWithReferenceUid</span>()
ArrayList<String> array = new ArrayList<String>();
<span>array.add("description");</span>
<span>array.add("name");</span>
<span>entry.onlyWithReferenceUid(array, "referenceUid");</span>
```

Array of the except reference keys to be excluded in response

Key who has reference to some other class object

## onlyWithReferenceUid

The onlyWithReferenceUid method specifies an array of reference UIDs that should be included in the response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
ArrayList<String> array = new ArrayList<String>();
array.add("description");
array.add("name");
entry.onlyWithReferenceUid(array, "referenceUid");
```

Array of the only reference keys to be included in response.

Key who has reference to some other class object

## only

The only method specifies an array of keys in the base object to include in the response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.only(new String[]{"name", "description"});
```

Array of the only reference keys to be included in response

## includeReference

The includeReference method adds a constraint that requires the details of a specified reference key.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.includeReference(new String[]{"referenceUid_A", "referenceUid_B"});
```

referenceFields array key that to be constrained

## except

The except method specifies an array of field UIDs that are excluded from the response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.except(new String[]{"name", "description"});
```

field uid which get excluded from the response.

## setLocale

The setLocale method sets the language of the entry.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.setLocale();
```

language code

## getLocale

The `getLocale` method retrieves the locale of the entry, indicating the language of the content.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.getLocale();
```

## getUid

The getUid method retrieves the UID of the entry.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.getUid()
```

## getContentType

The getContentType method retrieves the content type of the entry.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.getContentType()
```

## getTags

The getTags method retrieves the tags associated with the entry.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.<span>getTags</span>()
```

## removeHeader

The removeHeader method removes a header associated with the specified key.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.removeHeader(key);
```

key of the header you want to remove

## setHeader

The setHeader method adds a header using the specified key and value.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
Entry entry = entry.setHeader(key, value)
```

key of the header you want to remove

value of the header against the key

## fetch

The fetch method retrieves the entry using its UID, and can optionally include query parameters to refine the response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.fetch(new EntryResultCallBack() {
@Override public void onCompletion(ResponseType responseType, Error error) {
}
});}
```

EntryResultCallBack object to notify the application when the request has completed

## addParam

The addParam method adds query parameters to the entry request to filter the response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.addParam(key, value)
```

key of the header

value of the header

## includeReferenceContentTypeUID

The includeReferenceContentTypeUID method includes the content type UIDs of referenced entries in the entry response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.includeReferenceContentTypeUID()
```

## includeContentType

The includeContentType method includes the content type UID of the entry.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.includeContentType()
```

## includeFallback

The includeFallback method includes the fallback language content in the entry response when the specified locale content is unavailable.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.includeFallback()
```

## includeEmbeddedItems

The includeEmbeddedItems method includes embedded items in the entry response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("contentType").entry("entryUid");
entry.includeEmbeddedItems()
```

## includeBranch

The includeBranch method includes the branch information in the entry response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(<span>context, </span>apiKey, deliveryToken, environment);
final Entry entry = stack.contentType("user").entry("entryUid");
entry.includeBranch();
```

## includeMetadata

The includeMetadata method includes the entry metadata along with the response body.

```
Stack stack = Contentstack.stack(context, "apiKey", "deliveryToken", environment_name);
Entry entry = stack.contentType("contentTypeUid").entry("entryUid");
entry.includeMetadata();
```

## variants

The variants method retrieves details of a specific entry variant or an array of entry variants based on the applied query.

When Personalize creates a variant in the CMS, it assigns a "Variant Alias" to identify that specific variant. When fetching entry variants using the Delivery API, you can pass variant aliases in place of variant UIDs in the x-cs-variant-uid header.

```
Example 1:
import com.contentstack.sdk.*;
Stack stack = Contentstack.stack(apiKey, deliveryToken, environment);
final Entry entry = stack
                    .contentType("contentType")
                    .entry("entryUid")
                    .variants("variantUid/variantAlias");
 entry.fetch(new EntryResultCallBack() {
     @Override
     public void onCompletion(ResponseType responseType, Error error) {
              System.out.println(entry.toJSON());
         }
 });
Example 2:
import com.contentstack.sdk.*;
Stack stack = Contentstack.stack(apiKey, deliveryToken, environment);
final Entry entry = stack
                    .contentType("contentType")
                    .entry("entryUid")
                    .variants(new String[]{"variantUid1/variantAlias1","variantUid2/variantAlias2"});
 entry.fetch(new EntryResultCallBack() {
     @Override
     public void onCompletion(ResponseType responseType, Error error) {
              System.out.println(entry.toJSON());
         }
 });
```

Enter the UID/Alias of the variant

## Entry | Android Delivery SDK | Contentstack

Entry represents a single piece of content created from a content type in the Android Delivery SDK, giving access to its field data.