Updated on 2025-07-14 GMT+08:00

Adding an Application

Function

Adds an application.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

POST /v1/{project_id}/app-center/apps

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Application name. Requirements:

  1. Cannot contain only spaces.

  2. Cannot contain characters like :^;|~`{}[]<>.

  3. Contains 1 to 128 characters.

version

Yes

String

Version number.

description

Yes

String

Description.

authorization_type

Yes

String

ALL_USER: all users

ASSIGN_USER: authorized users

app_file_store

Yes

FileStoreLink object

The file storage path can be OBS or an external URL. store_type specifies the configuration that takes effect. Either bucket_store or file_link must be set.

app_icon_url

No

String

Image path. An accessible URL or DataURIscheme can be used.

Accessible URL: https://abc.a.ab.a/abc/ab.jpg

DataURIscheme: data;image/png;base64,iVBORw0KGgoAAAANS. When dataURLStream is used, a PNG image of about 64 KB can be used and a string can contain up to 87,500 characters.

install_type

Yes

String

Installation method:

QUIET_INSTALL: silent installation

Installation command (silent installation command), for example, ${FILE_PATH} /S.

UNZIP_INSTALL: installation after decompression

Example: unzip ${FILE_PATH}

GUI_INSTALL: GUI-based installation

If install_type is set to QUIET_INSTALL or UNZIP_INSTALL, install_command cannot be empty.

The predefined variable will use the following value:

${FILE_PATH}: local storage path of the application installation package on the desktop

install_command

No

String

Installation command (silent installation command).

Example: ${FILE_PATH} /S.

The predefined variable will use the following value:

${FILE_PATH}: local storage path of the application installation package on the desktop

uninstall_command

No

String

Uninstallation command (silent uninstallation command).

Example: msiexec /uninstall ${FILE_PATH} /quiet.

The predefined variable will use the following value:

${FILE_PATH}: local storage path of the application installation package on the desktop

support_os

Yes

String

OS type:

  • Linux

  • Windows

  • Other

catalog_id

Yes

String

Category ID.

install_info

No

String

Installation information.

Table 5 BucketStore

Parameter

Mandatory

Type

Description

bucket_name

No

String

The bucket name is in the format of wks-appcenter-{project_id}.

You need to call the bucket authorization API to authorize access to the bucket.

bucket_file_path

No

String

OBS object path.

Note: bucket_file_path is the complete path of the object in OBS and cannot start with a slash (/).

For example, the bucket has the following directory structure:

Bucket:

├─dir1

| ├─object1.txt

| └─object2.txt

└─object3.txt

Path of object 1: dir1/object1.txt

Path of object 2: dir1/object2.txt

Path of object 3: object3.txt

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

id

String

Unique ID.

tenant_id

String

Tenant ID.

name

String

Application name.

version

String

Version number.

description

String

Description.

authorization_type

String

ALL_USER: all users

ASSIGN_USER: authorized users

app_file_store

FileStoreLink object

Application storage information.

app_icon_url

String

Application icon path.

install_type

String

Installation method:

QUIET_INSTALL: silent installation

Installation command (silent installation command), for example, ${FILE_PATH} /S.

UNZIP_INSTALL: installation after decompression

Example: unzip ${FILE_PATH}

GUI_INSTALL: GUI-based installation

If install_type is set to QUIET_INSTALL or UNZIP_INSTALL, install_command cannot be empty.

The predefined variable will use the following value:

${FILE_PATH}: local storage path of the application installation package on the desktop

install_command

String

Installation command (silent installation command).

Example: ${FILE_PATH} /S.

The predefined variable will use the following value:

${FILE_PATH}: local storage path of the application installation package on the desktop

uninstall_command

String

Uninstallation command (silent uninstallation command).

Example: msiexec /uninstall ${FILE_PATH} /quiet.

The predefined variable will use the following value:

${FILE_PATH}: local storage path of the application installation package on the desktop

support_os

String

OS type:

  • Linux

  • Windows

  • Other

status

String

Application status:

NORMAL: normal

FORBIDDEN: forbidden to use

application_source

String

Application source:

CUSTOM: uploaded by users

SYSTEM: built-in application

MARKET: market application

create_time

DateTime

Application creation time.

catalog_id

String

Category ID.

catalog

String

Category name.

install_info

String

Installation information.

Table 8 BucketStore

Parameter

Type

Description

bucket_name

String

The bucket name is in the format of wks-appcenter-{project_id}.

You need to call the bucket authorization API to authorize access to the bucket.

bucket_file_path

String

OBS object path.

Note: bucket_file_path is the complete path of the object in OBS and cannot start with a slash (/).

For example, the bucket has the following directory structure:

Bucket:

├─dir1

| ├─object1.txt

| └─object2.txt

└─object3.txt

Path of object 1: dir1/object1.txt

Path of object 2: dir1/object2.txt

Path of object 3: object3.txt

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 401

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 404

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 405

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 503

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Example Requests

{
  "name" : "notepad++.exe",
  "version" : "v1.1.1",
  "description" : "xxx",
  "authorization_type" : "ALL_USER",
  "app_file_store" : {
    "store_type" : "OBS",
    "bucket_store" : {
      "bucket_name" : "wks-appcenter-xxxx",
      "bucket_file_path" : "app-file/xxxx.exe"
    },
    "file_link" : "https://host-addresss/xxxxx.jpg"
  },
  "app_icon_url" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8 /w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
  "install_type" : "UNZIP_INSTALL",
  "install_command" : "${FILE_PATH} /S",
  "uninstall_command" : "msiexec /uninstall ${FILE_PATH} /quiet",
  "support_os" : "Windows",
  "catalog_id" : "xxxx-xxx-xxxx",
  "install_info" : "xxxx-xxx-xxxx"
}

Example Responses

Status code: 200

Response to a successful request.

{
  "id" : "x-xx-xxx",
  "tenant_id" : "xxx-xx-x-xx",
  "name" : "xxx.exe",
  "version" : "v1.1.1",
  "description" : "Application used for testing.",
  "authorization_type" : "ALL_USER",
  "app_file_store" : {
    "store_type" : "OBS",
    "bucket_store" : {
      "bucket_name" : "wks-appcenter-xxxx",
      "bucket_file_path" : "app-file/xxxx.exe"
    },
    "file_link" : "https://host-addresss/xxxxx.jpg"
  },
  "app_icon_url" : "https://host-addresss/xxxxx",
  "install_type" : "QUIET_INSTALL",
  "install_command" : "${FILE_PATH} /S",
  "uninstall_command" : "msiexec /uninstall ${FILE_PATH} /quiet",
  "support_os" : "Windows",
  "status" : "NORMAL",
  "application_source" : "CUSTOM",
  "create_time" : "2024-12-25T06:56:58.622Z",
  "catalog_id" : 1,
  "catalog" : "Other",
  "install_info" : "Installation information"
}

Status Codes

Status Code

Description

200

Response to a successful request.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

No operation permissions.

404

No resources found.

405

The method specified in the request is not allowed.

500

An internal service error occurred. For details, see the error code description.

503

Service unavailable.

Error Codes

See Error Codes.