App

View as Markdown

App

App/Manifest is used for creating/updating/deleting an app in your organization.

Example:

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

App app = marketplace.app("installationId"); 

(or) App app = marketplace.app();
NameTypeDescription
organizationUid (required)String

UID of the organization

installationId String

UID of the app

addParam

The addParam method adds a header with the specified key and value to the current location and returns the updated location.

Specified by:

addParam in interface BaseImplementation<App>

NameTypeDescription
key (required)String

The key of the header to be added

value (required)Object

The value of the header to be added

Throws:

java.lang.NullPointerException - if the key or value argument is null

Example:

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

App app = marketplace.app().addParam("key","value");

addHeader

The addHeader method adds a header with the specified key and value to this location and returns the updated location.

Specified by:

addHeader in interface BaseImplementation<App>

NameTypeDescription
key (required)String

The key of the header to be added

value (required)String

The value of the header to be added

Throws:

java.lang.NullPointerException - if the key or value argument is null

Example:

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

App app = marketplace.app().addHeader("key","value");

addParams

The addParams method adds the specified parameters to this location and returns the updated location.

Specified by:

addParams

NameTypeDescription
params (required)HashMap

The parameters to be added

Throws:

java.lang.NullPointerException - if the params argument is null

Example:

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

HashMap param = new HashMap(); 

App app = marketplace.app().addParams(param);

addHeaders

The addHeaders method adds the specified parameters to this location and returns the updated location.

Specified by:

addHeaders provides support to add custom header to the request.

NameTypeDescription
headers (required)HashMap

The parameters to be added

Throws:

java.lang.NullPointerException - if the params argument is null

Example:

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

HashMap param = new HashMap(); 

App app = marketplace.app().addHeaders(param);

createInstallation

The createInstallation method creates an installation call.

NameTypeDescription
body (required)JSONObject

The body of the call

Example:

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

JSONObject body = new JSONObject(); 

App app = marketplace.app().createInstallation(body); 

Call response = app.execute();

updateVersion

The updateVersion method updates the version call.

NameTypeDescription
body (required)String

The body of the call

Example:

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

JSONObject body = new JSONObject(); 

App app = marketplace.app().updateVersion(body); 

Call response = app.execute();

findAppAuthorizations

The findAppAuthorizations method finds the app authorizations call.

Example:

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

App app = marketplace.app().findAppAuthorizations(); 

Call response = app.execute();

deleteAuthorization

The deleteAuthorization method deletes the authorization call.

NameTypeDescription
authorizationUid (required)String

UID of the authorization call

Example:

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

App app = marketplace.app().deleteAuthorization("authorizationUid"); 

Call response = app.execute();

findAppInstallations

The findAppInstallations method finds the app installation call.

Example:

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

App app = marketplace.app().findAppInstallations(); 

Call response = app.execute();

findApps

The findApps method finds the app's call.

Example:

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

App app = marketplace.app().findApps(); 

Call response = app.execute();

createApp

The createApp method creates an app call.

NameTypeDescription
body (required)JSONObject

The body of the call

Example:

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

JSONObject body = new JSONObject(); 

App app = marketplace.app().createApp(body); 

Call response = app.execute();

fetchApp

The fetchApp method fetches the app call.

Example:

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

App app = marketplace.app().fetchApp(); 

Call response = app.execute();

updateApp

The updateApp method updates the app call.

NameTypeDescription
body (required)JSONObject

The body of the call

Example:

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

JSONObject body = new JSONObject(); 

App app = marketplace.app().updateApp(); 

Call response = app.execute();

findAppRequests

The findAppRequests method retrieves a call to list app requests with specified headers, app UID, and parameters.

Example:

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

App app = marketplace.app().findAppRequests(); 

Call response = app.execute();

oauth

The oauth method retrieves an instance of oauth

NameTypeDescription
idString

The UID of the app

Example:

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

Oauth oauth = marketplace.app().oauth("id");

hosting

The hosting method retrieves an instance of hosting.

NameTypeDescription
idString

The UID of the app

Example:

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

Hosting hosting = marketplace.app().hosting("appId");