Installation

View as Markdown

Installation

Contentstack Marketplace enables users to directly install prebuilt apps and starters. However, app installations are subject to access restrictions, meaning your ability to view all or certain installed apps depends on the permissions granted at both the stack and organization levels.

  • If you are an organization admin or owner, you will be able to see all the stack and organization apps installed by any user in your organization.
  • If you are a stack admin or owner, you will be able to see the apps installed for the stacks that you have access to.
  • If you are not a stack admin or owner, you will be able to see the apps installed for the stacks that you have access to.

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

Installation installation = marketplace.installation();
NameTypeDescription
organizationId (required)String

UID of the organization

installationId String

UID for the installation

validateInstallationId

The validateInstallationId method validates if the installationId is not null or empty.

NameTypeDescription
installationId (required)String

UI for the installation

Example:

Installation installation = marketplace.installation();

Installation installation = marketplace.installation("installationId");

location

The location method returns a new Location object with the specified client, organisationId, and installationId.

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

Installation installation = marketplace.installation(); 

Call result = installation.location().execute();

webhook

The webhook method creates and returns a new Webhook object with the given parameters.

NameTypeDescription
webhookId (required)String

UID of the webhook

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

Installation installation = marketplace.installation(); 

JSONObject body = new JSONObject(); 

Call result = installation.webhook("webhookId").execute();

addParam

The addParam method adds a parameter to the collection using a key-value pair.

Specified by:

addParam in interface BaseImplementation

NameTypeDescription
key (required)String

The key of the header to be added

value (required)Object

The value of the header to be added

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

Installation installation = marketplace.installation().addParam("key", "value");

addParams

The addParams method takes a HashMap of parameters and returns a generic type T.

Specified by:

addParams in interface BaseImplementation

NameTypeDescription
key (required)String

The key of the header to be added

value (required)Object

The value of the header to be added

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

HashMap parameters = new HashMap(); 

Installation installation = marketplace.installation().addParams(parameters);

addHeader

The addHeader method adds a header with a specified key and value to a request.

Specified by:

addHeader in interface BaseImplementation

NameTypeDescription
key (required)String

The key of the header to be added

value (required)String

The value of the header to be added

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

Installation installation = marketplace.installation().addHeader("key", "value");

addHeaders

The addHeaders method takes a HashMap of headers and adds them to the request.

Specified by:

addHeaders provides support to add custom header to the request

NameTypeDescription
key (required)String

The key of the header to be added

value (required)String

The value of the header to be added

Example:

Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 

HashMap parameters = new HashMap(); 

Installation installation = marketplace.installation().addHeaders(parameters);