Contentstack

View as Markdown

Contentstack

A stack is a repository or a container that holds all the entries/assets of your site. It allows multiple users to create, edit, approve, and publish their content within a single space.

The stack function initializes an instance of the Stack. To initialize a stack execute the following code:

stack

A stack method provides access to the stack of your site. It allows users to get the content within a single space.

NameTypeDescription
apiKey (required)String

API Key of your application on Contentstack

deliveryToken (required)String

Delivery Tokens retrieves only the published entries of the environment with which it is associated

environment (required)String

A publishing environment refers to one or more deployment servers or a content delivery destination (Webpage’s address) where you will publish your content (entries or assets).

configConfig

Config instance to set environment and other configuration details.

import com.contentstack.sdk.*;

 

Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");

Example with Config:

import com.contentstack.sdk.*; 


Config config = new Config().setHost("api.contentstack.io");

Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");