Stack
Stack
Stack an instance of ContentType, asset, assetQuery, and sync
syncToken
In this API request, you need to provide the sync_token that you received in the last complete sync process. If there are more than 100 records, you will get a pagination_token instead
| Name | Type | Description |
|---|---|---|
| syncToken | String | sync token fetches only the content that was added after your last sync |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.syncToken("syncToken")sync
The Sync API takes care of syncing your Contentstack data with your app and ensures that the data is always up-to-date by providing delta updates.
| Name | Type | Description |
|---|---|---|
| contentTypeUid | String | content type UID. e.g., products This retrieves published entries of specified content type. |
| fromDate | String | Enter the start date. e.g., 2018-08-14T00:00:00.000Z This retrieves published entries starting from a specific date |
| locale | String | Enter locale code. e.g., en-us This retrieves published entries of the specific locale |
| publishType | PublishType | Applicable values are:
If you do not specify any value, it will bring all published entries and published assets. |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.sync("contentTypeUid", "fromDate", "locale", PublishType.Entry_Published)setHost
Adds host for the request
| Name | Type | Description |
|---|---|---|
| host (required) | String | The host for the API url |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.setHost("host") </span>setHeader
adds header using header key and value
| Name | Type | Description |
|---|---|---|
| key (required) | String | The header key |
| value (required) | String | the header value |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.setHeader("headerKey", "headerValue") </span>removeHeader
Remove header using headerKey
| Name | Type | Description |
|---|---|---|
| headerKey (required) | String | The header key |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.removeHeader("headerKey") </span>paginationToken
| Name | Type | Description |
|---|---|---|
| paginationToken (required) | String | The pagination token |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.paginationToken("paginationToken") </span>imageTransform
The Image Delivery API is used to retrieve, manipulate and/or convert image files of your Contentstack account and deliver it to your web or mobile properties.
| Name | Type | Description |
|---|---|---|
| imageUrl (required) | String | Base Image Url of the image you want to manipulate |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var image = stack.
</span>getContentTypes
ContentType accepts contentTypeId in as the parameter
| Name | Type | Description |
|---|---|---|
| queryParams (required) | Map | ContentType accepts query params as parameter |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var contentType = stack.contentType
ContentType accepts contentTypeId in as the parameter
| Name | Type | Description |
|---|---|---|
| contentTypeId (required) | String | ContentType accepts contentTypeId as the parameter |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var contentType = stack.contentType("contentTypeId")assetQuery
It also returns the content of each asset in JSON format.
| Name | Type | Description |
|---|---|---|
| uid (required) | String | Asset uid |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var assets = stack.assetQuery()asset
This call fetches the latest version of a specific. asset of a particular stack.
| Name | Type | Description |
|---|---|---|
| uid (required) | String | Asset uid |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var asset = stack.asset("uid")getLivePreview
Live preview of the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var preview = stack.getLivePreviewhost
host of the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var host = stack.hostenvironment
environment of the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var environment = stack.environmentendpoint
endpoint for the api
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var endpoint = stack.endpointdeliveryToken
delivery token for the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var deliveryToken = stack.deliveryTokenstack
an instance of the stack
| Name | Type | Description |
|---|---|---|
| apiKey (required) | String | apiKey of the stack |
| deliveryToken (required) | String | Delivery Token for the stack |
| environment (required) | String | Environment of the stack |
| apiVersion | String | apiVersion is version of the API Default: v3 |
| region | Region | DB region for your stack. You can choose from six regions namely, NA, EU, Azure NA, Azure EU, GCP NA, and GCP EU. |
| host | String | host of the api |
| livePreview | dict | live preview for the stack |
| client | BaseClient | Client to make API request |
import Contentstack final stack = contentstack.Stack(apiKey, deliveryToken, environment);
apiKey
apiKey of for the stack
import Contentstack
final stack = contentstack.Stack("
", "
", "
");
var apiKey = stack.apiKey