AppRequest
AppRequest
If a user does not have the necessary permissions to install an app in an organization or stack, they can request the organization or stack administrator to install the app on their behalf. To do this, the user clicks the Request Install button.
Once the request is made, the organization or stack administrator can then approve or reject the request.
Example:
AppRequest appRequest = marketplace.request();
| Name | Type | Description |
|---|---|---|
| orgId (required) | String | UID of the organization |
addParam
The addParam method adds a parameter to a collection using a key-value pair.
Specified by:
addParam in interface BaseImplementation
| Name | Type | Description |
|---|---|---|
| key (required) | String | The key of the header to be added |
| value (required) | Object | The value of the given key in the queryParams map |
Example:
Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build();
AppRequest appRequest = marketplace.request();
appRequest.addParam("key", "value");addHeader
The addHeader method adds a header with a specified key and value to a request.
Specified by:
addHeader in interface BaseImplementation
| Name | Type | Description |
|---|---|---|
| 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();
AppRequest appRequest = marketplace.request();
appRequest.addHeader("key", "value");addHeaders
The addHeaders method adds headers to a HashMap and adds them to the request.
Specified by:
addHeaders provides support to add custom header to the request
| Name | Type | Description |
|---|---|---|
| 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();
AppRequest appRequest = marketplace.request();
HashMap headers = new HashMap();
appRequest.addHeaders(headers);addParams
The addParams method adds all the key-value pairs from the given HashMap to the queryParams HashMap and returns the updated AppRequest object.
Specified by:
addParams in interface BaseImplementation
| Name | Type | Description |
|---|---|---|
| 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("api.contentstack.io").build();
AppRequest appRequest = marketplace.request();
HashMap headers = new HashMap();
appRequest.addParams(headers);