Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. All you have to do is build your application frontend, and Contentstack will take care of the rest.
This SDK uses the Content Management API (CMA). The CMA is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account. To use the CMA, you will need to authenticate your users with a Management Token or an Authtoken. Read more about it in Authentication.
Note: By using CMA, you can execute GET requests for fetching content. However, we strongly recommend that you always use the Content Delivery API to deliver content to your web or mobile properties.
Prerequisite
You need Java JDK 8 version or above installed on your machine to use the Contentstack Java CMS SDK.
Java Management SDK Interact with the Content Management APIs and allow you to create, update, delete, and fetch content from your Contentstack account.
organisation
The organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users. The organization allows easy management of projects as well as users within the Organization.
A Stack is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.
Returns:
Type
Stack
Name
Type
Description
apiKey
String
The apiKey for the stack
managementToken
String
The authorization for the stack
branch
String
The branch that include branching in the response
import contentstack;
Contentstackcontentstack=newContentstack.Builder().build();
Stackstack= contentstack.stack();
or
Stackstack= contentstack.stack("apiKey");
or
Stackstack= contentstack.stack("apiKey", "managementToken", "branch");
login
Before executing any calls, retrieve the authtoken by authenticating yourself via the login call of User Session. The authtoken is returned to the 'Response' body of the login call and is mandatory in all the calls.
All accounts registered with Contentstack are known as Users. A Stack can have many users with varying permissions and roles.
activateAccount
The activate_token a user account call activates the account of a user after signing up.
Returns:
Type
Call
Name
Type
Description
activationToken (required)
String
The activation token is received at the registered email address. You can find the activation token in the activation URL sent to the email address used while signing up.
The "Get user" call returns comprehensive information about an existing user account. The information returned includes details of the stacks owned by and shared with the specified user account.
The "Reset password" call sends a request for resetting the password of your Contentstack account.
When executing the call, in the 'Body' section, you need to provide the token that you receive via email, your new password, and password confirmation in JSON format.
The "Update User" API Request updates the details of an existing user account. Only the information entered here will be updated; the existing data will remain unaffected.
When executing the API call, under the 'Body' section, enter the user's information that you wish to update. This information should be in JSON format.
An alias acts as a pointer to a particular branch. You can specify the alias ID in your frontend code to pull content from the target branch associated with an alias.
The "Assign an alias" request creates a new alias in a particular stack of your organization. This alias can point to any existing branch (target branch) of your stack.
Unpublish an asset call is used to unpublish a specific version of an asset from a desired environment.
In the case of Scheduled Unpublished, add the scheduled_at key and provide the date/time in the ISO format as its value. Example: "scheduled_at":"2016-10-07T12:34:36.000Z"
The Replace asset call will replace an existing asset with another file on the stack.
Tip: You can try the call manually in any REST API client, such as Postman. Under Body, pass a body parameter named asset[upload] and select the input type as 'File'. This will enable you to select the file that you wish to import. You can assign a parent folder to your asset by using the asset[parent_uid] parameter, where you can pass the UID of the parent folder. Additionally, you can pass optional parameters such as asset[title] and asset[description] which let you enter a title and a description for the uploaded asset, respectively.
The "Get details of all versions of an asset" request allows you to retrieve the details of all the versions of an asset.
The details returned include the actual version number of the asset; the version name along with details such as the assigned version name, the UID of the user who assigned the name, and the time when the version was assigned a name; and the count of the versions.
Returns:
Type
Call
Name
Type
Description
limit
Integer
Enter the maximum number of version details to be returned.
named
Boolean
Set to true if you want to retrieve only the named versions of your asset.
include_count
Boolean
Enter 'true' to get the total count of the asset version details.
The "Publish an asset" call is used to publish a specific version of an asset on the desired environment either immediately or at a later date/time.
In case of Scheduled Publishing, add the scheduled_at key and provide the date/time in the ISO format as its value. Example: "scheduled_at":"2016-10-07T12:34:36.000Z"
The "Download an asset with a permanent URL" request displays an asset in the response. The asset returned to the response can be saved to your local storage system. Make sure to specify the unique identifier (slug) in the request URL.
This request will return the most recent version of the asset; however, to download the latest published version of the asset, pass the environment query parameter with the environment name.
Generate Permanent Asset URL request allows you to generate a permanent URL for an asset. This URL remains constant irrespective of any subsequent updates to the asset.
The "Get an asset" call returns comprehensive information about a specific version of an asset of a stack
Tip: To include the publishing details in the response, use the include_publish_details parameter and set its value to ‘true'. This query will return the publishing details of the entry in every environment, along with the version number published in each environment.
The "Delete Version Name of an Asset" request allows you to delete the name assigned to a specific version of an asset. This request resets the name of the asset version to the version number.
The "Get assets of a specific folder" retrieves all assets of a specific asset folder; however, it doesn't retrieve the details of sub-folders within it.
An audit log displays a record of all the activities performed in a stack and helps you track all published items, updates, deletes, and the current status of the existing content.
find
The "Get audit log" request is used to retrieve the audit log of a stack.
Branches allow you to isolate and easily manage your “in-progress” work from your stable, live work in the production environment. It helps multiple development teams to work in parallel in a more collaborative, organized, and structured manner without impacting each other.
create
The "Create a branch" request creates a new branch in a particular stack of your organization.
Use the BulkOperation class to perform actions—such as publishing, unpublishing, deleting, or updating workflows—on multiple entries and assets in a single API request.
create
The create method creates a new release in the stack.
Returns:
Type
Call
Name
Type
Description
requestBody (required)
JSONObject
The requestBody to create a release.
Example:
import contentstack;
Contentstackcontentstack=newContentstack.Builder().build();
Releaserelease= contentstack.stack().releases();
Call<ResponseBody> response = release.create(requestBody).execute();
if (response.isSuccessful()) {
System.out.println("Release created successfully.");
}
unpublish
The unpublish method removes multiple entries and assets from specific environments and locales.
The jobStatus method allows you to check the status of a bulk job.
Returns:
Type
Promise
Name
Type
Description
params.job_id (required)
string
UID of the bulk job
params.bulk_version
string
The bulk operation version (2.0)
Example:
import contentstack;
Contentstackcontentstack=newContentstack.Builder().build();
BulkOperationbulkOperation= contentstack.stack().bulkOperation();
Call<ResponseBody> response = bulkOperation.jobStatus("jobId").execute();
if (response.isSuccessful()) {
System.out.println("Job status retrieved");
}
ContentType
The content type defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required first to create a content type and then create entries using the content type.
You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include_branch query parameter to true to include the _branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.
referenceIncludeGlobalField
The "Get all references of content type" call will fetch all the content types in which a specified content type is referenced.
Note: You must use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication. You need to use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request
The "Set Field Visibility Rule for Content Type API request" lets you add Field Visibility Rules to existing content types. These rules allow you to show and hide fields based on the state or value of certain fields.
The "Get all references of content type" call will fetch all the content types in which a specified content type is referenced.
Note: You must use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication. You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.
This call is used to export a specific content type and its schema. The data is exported in JSON format. However, please note that the entries of the specified content type are not exported through this call. The schema of the content type returned will depend on the version number provided.
Note: You must use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.
The "Get all content types" call returns comprehensive information on all the content types available in a particular stack in your account.
Note: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.
The "Delete Content Type" call deletes an existing content type and all the entries within it. When executing the API call, in the URI Parameters section, provide the UID of your content type.
An entry is the actual piece of content created using one of the defined content types.
You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include_branch query parameter to true to include the _branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.
versionName
Version naming allows you to assign a name to a version of an entry for easy identification.
Returns:
Type
Call
Name
Type
Description
version (required)
Integer
Enter the version number of the entry to which you want to assign a name.
The "Unpublish an entry" call will unpublish an entry at once and allow you to do so automatically at a later date/time.
In the 'Body' section, you can specify the locales and environments from which you want to unpublish the entry. These details should be specified in the entry parameter. However, if you do not specify a locale, it will be unpublished from the master locale automatically.
You also need to mention the master locale and the version number of the entry that you want to publish.
In the case of Scheduled Unpublished, add the scheduled_at key and provide the date/time in the ISO format as its value.
The "Publish an entry" request lets you publish an entry either immediately or schedule it for a later date/time.
In the 'Body' section, you can specify the locales and environments to which you want to publish the entry. When you pass locales in the "Body", the following actions take place:
If you have not localized your entry in any of your stack locales, the Master Locale entry gets localized in those locales and is published
If you have localized any or all of your entries in these locales, the existing localized content of those locales will NOT be published. However, if you need to publish them all, you need to perform a Bulk Publish operation.
The locale and environment details should be specified in the entry parameter. However, if you do not specify any source locale(s), it will be published in the master locale automatically.
Along with the above details, you also need to mention the master locale and the version number of the entry that you want to publish.
Returns:
Type
Call
Name
Type
Description
requestBody (required)
String
In the "Body" parameter, you need to provide the content of your entry based on the content type.
The "Localize an entry" request allows you to localize an entry, i.e., the entry will cease to fetch data from its fallback language and possess independent content specific to the selected locale.
Note: This request will only create the localized version of your entry and not publish it. To publish your localized entry, you need to use the Publish an entry request and pass the respective locale code in the locale={locale_code} parameter.
Returns:
Type
Call
Name
Type
Description
requestBody (required)
String
In the "Body" parameter, you need to provide the content of your entry based on the content type.
localeCode (required)
Object
Enter the code of the language to localize the entry of that particular language.
The "Get Details of All Versions of an Entry" request allows you to retrieve the details of all the versions of an entry.
The version details returned include the actual version number of the entry; the version name along with details such as the assigned version name, the UID of the user who assigned the name, and the time when the version was assigned a name; and the locale of the entry.
Atomic operations are particularly useful when we do not want content collaborators to overwrite data. Though it works efficiently for singular fields, these operations come in handy, especially in the case of fields that are marked as "Multiple".
Returns:
Type
Call
Name
Type
Description
versionNumber (required)
Integer
Enter the version number of the entry that you want to delete.
The "Find" call fetches the list of all the entries of a particular content type. It also returns the content of each entry in JSON format. You can also specify the environment and locale where you wish to get the entries.
The "Delete an entry" request allows you to delete a specific entry from a content type. This API request also allows you to delete single and/or multiple localized entries.
Returns:
Type
Call
Name
Type
Description
requestBody
You can delete specific localized entries by passing the locale codes in the Request body using the locales key.
The "Import an entry" call is used to import an entry. To import an entry, you need to upload a JSON file that has entry data in the format that fits the schema of the content type it is being imported to.
The Import an existing entry call will import a new version of an existing entry. You can create multiple versions of an entry.
A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.
update
The "Update environment" call will update the details of an existing publishing environment for a stack.
When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
"Delete environment" call will delete an existing publishing environment from your stack.
When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
The "Add an environment call" will add a publishing environment for a stack.
When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
Delivery tokens provide read-only access to the associated environments, while management tokens provide read-write access to the content of your stack. Use these tokens and the stack API key to make authorized API requests.
delete
The "Delete delivery token" request deletes a specific delivery token.
The "Update delivery token" request lets you update the details of a delivery token.
In the Request Body, you need to pass the updated details of the delivery token in JSON format. The details include the updated name, description, and/or the environment of the delivery token.
The Create delivery token request creates a delivery token in the stack.
In the Request Body, you need to pass the details of the delivery token in JSON format. The details include the name, description, and environment of the delivery token.
Extensions let you create custom fields and widgets to customize Contentstack default UI and behavior.
You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include_branch query parameter to true to include the _branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.
uploadCustomField
The "Upload a custom field" request is used to upload a custom field to Contentstack.
Returns:
Type
Call
Name
Type
Description
upload
html
Select the HTML file of the custom field that you want to upload.
title
String
Enter the title of the custom field that you want to upload.
data_type
String
Enter the data type for the input field of the custom field.
tags
String
Enter the tags that you want to assign to the custom field.
multiple
Boolean
Enter ‘true’ if you want your custom field to store multiple values.
type
String
Enter the type as ‘field’ since this is a custom field extension.
The "Update or move folder" request can be used either to update the details of a folder or set the parent folder if you want to move a folder under another folder.
When executing the API request, provide the UID of the folder that you want to move/update.
A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and effort) to repeatedly create the same set of fields in multiple content types.
You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. You can also set the include_branch query parameter to true to include the _branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.
create
The Create a global field request allows you to create a new global field in a particular stack of your Contentstack account. You can use this global field in any content type within your stack.
Note: Only the stack owner, administrator, and developer can create global fields. You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
The "Import global field" call imports global fields into Stack.
Note: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.
The "Update a global field" request allows you to update the schema of an existing global field.
When executing the API call, in the URI Parameters section, provide the unique ID of your global field.
Note: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.
The "Get all global fields" call returns comprehensive information on all the global fields available in a particular stack in your account
Note: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
The "Get a Single global field" request lets you fetch comprehensive details of a specific global field.
When executing the API call, in the URI Parameters section, provide the unique ID of your global field.
Note: You need to use either the stack's Management Token or the user Authtoken (one of them is mandatory), along with the stack API key, to make a valid Content Management API request.
Labels allow you to group a collection of content within a stack. Using labels, you can group content types that need to work together.
You can now pass the branch header in the API request to fetch or manage modules located within specific branches of the stack. Additionally, you can also set the include_branch query parameter to true to include the _branch top-level key in the response. This key specifies the unique ID of the branch where the concerned Contentstack module resides.
The "Find label" call fetches all the existing labels of the stack.
When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
Using addParam(String, Object), you can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.
When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
Contentstack has a sophisticated, multilingual capability. It allows you to create and publish entries in any language. This feature allows you to set up multilingual websites and cater to a wide variety of audiences by serving content in their local language(s).
update
The "Update language" call will let you update the details (such as display name) and the fallback language of an existing language of your stack.
When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.
The "Delete language" call deletes an existing language from your stack.
When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
This call fetches the list of all languages (along with the language codes) available for a stack.
When executing the API call, under the Header section, you need to enter the authtoken that you receive after logging into your account.
You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.
The "Set a fallback" language request allows you to assign a fallback language for an entry in a particular language.
When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging in to your account.
The "Update fallback language" request allows you to update the fallback language for an existing language of your stack.
When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging in to your account.
This call lets you add a new language to your stack. You can either add a supported language or a custom language of your choice.
When executing the API call, under the Header section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.
To authenticate Content Management API (CMA) requests over your stack content, you can use Management Tokens.
update
The "Update management token" request lets you update the details of a management token. You can change the name and description of the token, update the stack-level permissions assigned to the token, and change the expiry date of the token (if set).
The "Get a single management token" request returns the details of a specific management token generated in a stack and NOT the actual management token.
The "Create management token" request creates a management token in a stack. This token provides you with read-write access to the content of your stack.
The Publish Queue displays the historical and current details of activities such as publishing, unpublishing, or deleting that can be performed on entries and/or assets. It also shows details of Release deployments. These details include time, entry, content type, version, language, user, environment, and status.
cancelScheduledAction
The "Cancel Scheduled Action" request will allow you to cancel any scheduled publishing or unpublishing activity of entries and/or assets and cancel the deployment of releases.
The "Get publish queue activity" request returns comprehensive information on a specific publish, unpublish, or delete action performed on an entry and/or asset. You can also retrieve details of a specific release deployment.
The "Get publish queue" request returns comprehensive information on activities such as publish, unpublish, and delete performed on entries and/or assets. This request also includes the details of the release deployments in the response body.
The "Get all items in a Release" request retrieves a list of all items (entries and assets) that are part of a specific Release and perform CRUD operations on it.
createMultiple
The "Add multiple items to a Release" request allows you to add multiple items (entries and/or assets) to a Release.
When executing the API request, you need to provide the Release UID.
The "Update Release items to their latest versions" request let you update all the release items (entries and assets) to their latest versions before deployment
Note: You need to use either the stack's Management Token or the user Authtoken (anyone is mandatory), along with the stack API key, to make a valid Content Management API request.
The Releases class provides methods to create, manage, and deploy content releases that group entries and assets for coordinated publishing across environments.
Note: Pass the release_version parameter as 2.0 in the Headers section if you have the latest release enabled for your organization. Reach out to our support team for more information.
create
The create method creates a new release in the stack.
Returns:
Type
Call
Name
Type
Description
requestBody (required)
JSONObject
The requestBody to create a release.
Example:
import contentstack;
Contentstackcontentstack=newContentstack.Builder().build();
Releaserelease= contentstack.stack().releases();
Call<ResponseBody> response = release.create(requestBody).execute();
if (response.isSuccessful()) {
System.out.println("Release created successfully.");
}
update
The update method modifies the name, description, or schedule of an existing release.
A stack is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.
workflow
A workflow is a tool that allows you to streamline the process of content creation and publishing and lets you manage the content lifecycle of your project smoothly.
Returns:
Type
Workflow
Name
Type
Description
workflowUid
String
The UID of your workflow that you want to retrieve.
A role is a collection of permissions that is applied to all the users who are assigned this role.
Returns:
Type
Call
Name
Type
Description
body (required)
JSONObject
The Update User Role API Request updates the roles of an existing user account. This API Request will override the existing roles assigned to a user. For example, we have an existing user with the Developer role, and if you execute this API request with the "Content Manager" role, the user role will lose Developer rights, and the user role be updated to just Content Manager.
A webhook is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account. Webhooks allow you to specify a URL to which you would like Contentstack to post data when an event happens.
Returns:
Type
Webhook
Name
Type
Description
webhookUid
String
Enter the unique webhook ID from which you want to retrieve the details. Execute the Get all webhooks call to retrieve the UID of a webhook.
The "Unshare stack" removes the user account from the list of collaborators. Once this call is executed, the user will not be able to view the stack in their account.
The Transfer stack ownership to other users calls sends the specified user an email invitation for accepting the ownership of a particular stack.
Once the specified user accepts the invitation by clicking on the link provided in the email, the ownership of the stack gets transferred to the new user. Subsequently, the previous owner will no longer have permission on the stack.
Contentstack provides different types of tokens to authorize API requests. You can use Delivery Tokens to authenticate Content Delivery API (CDA) requests and retrieve the published content of an environment. To authenticate Content Management API (CMA) requests over your stack content, you can use Management Tokens.
Delivery tokens provide read-only access to the associated environments, while management tokens provide read-write access to the content of your stack. Use these tokens along with the stack API key to make authorized API requests
The "Reset stack settings" call resets your stack to default settings and, additionally, lets you add parameters to or modify the settings of an existing stack.
You can pin a set of entries and assets (along with the deploy action, i.e., publish/unpublish) to a release, and then deploy this release to an environment. This will publish/unpublish all the items of the release to the specified environment.
Returns:
Type
Releases
Name
Type
Description
releaseUid
String
The unique ID of the release of which you want to retrieve the details.
The Publishing Queue displays the historical and current details of activities such as publishing, unpublishing, or deleting that can be performed on entries and/or assets. It also shows details of Release deployments. These details include time, entry, content type, version, language, user, environment, and status.
Returns:
Type
PublishQueue
Name
Type
Description
publishQueueUid
String
The UID of a specific publish queue activity of which you want to retrieve the details. Execute the Get publish queue API request to retrieve the UID of a particular publish queue activity.
Contentstack has a sophisticated, multilingual capability. It allows you to create and publish entries in any language. This feature allows you to set up multilingual websites and cater to a wide variety of audiences by serving content in their local language(s).
A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and effort) to create the same set of fields repeatedly in multiple content types.
The ContentType defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type.
Returns:
Type
ContentType
Name
Type
Description
contentTypeUid
String
Enter the unique ID of the content type from which you want to retrieve the details. The UID is generated based on the title of the content type. The unique ID of a content type is unique across a stack
Branches allow you to isolate and easily manage your in-progress work from your stable, live work in the production environment. It helps multiple development teams to work in parallel in a more collaborative, organized, and structured manner without impacting each other.
Returns:
Type
Branch
Name
Type
Description
branchUid
String
The unique ID of the branch of which you want to retrieve the details.
An audit log displays a record of all the activities performed in a stack and helps you track all published items, updates, deletes, and the current status of the existing content.
Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use.
Returns:
Type
Asset
Name
Type
Description
assetUid (required)
String
The asset Uid.
folder
String
Enter either the UID of a specific folder to get the assets of that folder or enter ‘cs_root’ to get all assets and their folder details from the root folder.
Example:bltd899999999.
include_folders
Boolean
Set this parameter to ‘true’ to include the details of the created folders along with the details of the assets.
Example:true.
environment
String
Enter the name of the environment to retrieve the assets published on them. You can enter multiple environments.
Example: production
version
Integer
Specify the version number of the asset that you want to retrieve. If the version is not specified, the details of the latest version will be retrieved.
Example:1
include_publish_details
Boolean
Enter 'true' to include the published details of the entry. Example:true
include_count
Boolean
Set this parameter to 'true' to include the total number of assets available in your stack in the response body.
relative_urls
Boolean
Set this to 'true' to display the relative URL of the asset.
asc_field_uid
String
Enter the unique ID of the field for sorting the assets in ascending order by that field.
Example:created_at
desc_field_uid
String
Enter the unique ID of the field for sorting the assets in descending order by that field.
Example:file_size
include_branch
Boolean
Set this to 'true' to include the _branch top-level key in the response. This key states the unique ID of the branch where the concerned Contentstack module resides.
An alias acts as a pointer to a particular branch. You can specify the alias ID in your frontend code to pull content from the target branch associated with an alias.
Returns:
Type
alias
Name
Type
Description
aliasUid
String
The unique ID of the alias of which you want to retrieve the details. The UID of an alias is unique across a stack. Execute the Get all aliases call to retrieve the UID of an alias
The "Accept stack owned by another user" call allows a user to accept the ownership of a particular stack via an email invitation.
Once the user accepts the invitation by clicking the link, the ownership is transferred to the new user account. Subsequently, the user who transferred the stack will no longer have any permission on the stack.
Returns:
Type
the stack
Name
Type
Description
ownershipToken (required)
String
The ownership token received via email by another user.
A webhook is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account. Webhooks allow you to specify a URL to which you would like Contentstack to post data when an event happens.
getExecutionLog
This call will return a comprehensive detail of all the webhooks that were executed at a particular execution cycle.
The "Get executions of a webhook" request allows you to fetch the execution details of a specific webhook, which includes the execution UID. These details are instrumental in retrieving webhook logs and retrying a failed webhook.
This call makes a manual attempt to execute a webhook after the webhook has finished executing its automatic attempts.
When executing the API call, in the URI Parameter section, enter the execution UID that you receive when you execute the 'Get executions of webhooks' call.
TheImport Webhooksection consists of the following two requests that will help you to import new Webhooks or update existing ones by uploading JSON files.
Workflow is a tool that allows you to streamline the process of content creation and publishing and lets you manage the content lifecycle of your project smoothly.
updatePublishRule
The "Add or Update Publish Rules" request allows you to add a publishing rule or update the details of the existing publishing rules of a workflow.
Returns:
Type
Call
Name
Type
Description
ruleUid (required)
String
The UID of the publishing rule that you want to update.
The "Get all Tasks" request retrieves a list of all tasks assigned to you.
When executing the API request, in the 'Header' section, you need to provide the API Key of your stack and the authtoken that you receive after logging into your account.
The Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources and users. The Organization allows easy management of projects and users within the organization.
roles
Gets organization roles.
Below are the parameters to use in the method - addParam(String, Object):
Returns:
Type
Call
Name
Type
Description
limit
Integer
The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.
skip
Integer
The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.
asc
String
The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.
desc
String
The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.
include_count
Boolean
The "include_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.
include_stack_roles
Boolean
The include_stack_roles parameter, when set to true, includes the details of stack-level roles in the Response body.
The "Get all stacks" in an organization call fetches the list of all stacks in an Organization
The query parameters for the method - addParam(String, Object) are as follows:
Returns:
Type
Call
Name
Type
Description
limit
Integer
The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.
skip
Integer
The 'skip' parameter will skip a specific number of organization roles in the output. Example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.
asc
String
The 'asc' parameter allows you to sort the list of organization invitations in ascending order on the basis of a specific parameter.
desc
String
The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.
include_count
Boolean
The 'include_count' parameter returns the number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.
typeahead
Boolean
The 'typeahead' parameter allows you to perform a name-based search on all the stacks in an organization based on the value provided.
The "Get all organizations" call lists all organizations related to the system user in the order that they were created
Following are the query parameters for the method - addParam(String, Object):
Returns:
Type
Call
Name
Type
Description
limit
Integer
The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.
skip
Integer
The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.
asc
String
The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.
desc
String
The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.
include_count
Boolean
The "include_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.
The "Get all organization invitations" call gives you a list of all the Organization invitations. Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.
When executing the API call, provide the Organization UID.
The query parameters for addParam(String, Object) are as follows:
Returns:
Type
Call
Name
Type
Description
limit
Integer
The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.
skip
Integer
The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.
asc
String
The 'asc' parameter allows you to sort the list of organization invitations in ascending order based on a specific parameter.
desc
String
The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.
include_count
Boolean
The 'include_count' parameter returns the total number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.
include_roles
String
The 'include_roles' parameter, when set to 'true', will display the details of the roles that are assigned to the user in an organization.
include_invited_by
Boolean
The 'include_invited_by' parameter, when set to 'true', includes the details of the user who sent out the organization invitation.
include_user_details
Boolean
The 'include_user_details' parameter, when set to 'true', lets you know whether the user who has been sent the organization invitation has enabled Two-factor Authentication or not.
The "Transfer organization ownership" call transfers the ownership of an Organization to another user. When the call is executed, an email invitation for accepting the ownership of a particular Organization is sent to the specified user.
The "Get Organization log details" request is used to retrieve the audit log details of an organization
Tip: This request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form.
The" Get Organization log details" request is used to retrieve the audit log details of an organization
Tip: This request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form
The "Add Users to organization" call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.
Taxonomy helps you categorize pieces of content within your stack to facilitate easy navigation, search, and retrieval of information. You can hierarchically organize your web properties based on your requirements, such as their purpose, target audience, or any other aspects of your business.
addParam
The addParam method adds a parameter to a collection using a key-value pair.
Get an instance of the taxonomy search filter class through which you can query on a taxonomy based on an entry endpoint. Provide the user's email address in JSON format.
Terms are the fundamental building blocks in a taxonomy. They are used to create hierarchical structures and are integrated into entries to classify and categorize information systematically.
addParam
The addParam method adds a parameter to a collection using a key-value pair.