Register Resource


Register resources.

Request Format


POST https://{apigw-address}/app-portal-service/v2.3/resource/create

Request Parameters (Query)


Name

Mandatory/Optional

Data Type

Description

orgId

Mandatory

String

OU ID.

Request Parameters (Body)


Name

Mandatory/Optional

Data Type

Description

resources

Mandatory

Resources Struct

The list of resources to register.

type

Mandatory

String

The ID of resource type.

assignCodeTold

Optional

Boolean

The resource code is the same as the resource id or not. true for the same, and false for not the same. The default value is false.

Response Parameters


Name

Data Type

Description

data

Data Struct

The result and information of the registered resources.

Data Struct


Name

Data Type

Description

success

Boolean

The result of registering resources, true for success, and false for failure.

resources

Resources Return Struct

Resource information.

Resources Return Struct


Name

Data Type

Description

id

String

Resource ID.

code

String

Resource code.

name

Object

Resource name.

type

String

Resource type.

Error Codes


Error Code

Description

31400

Required parameters are missing, or the resource name is invalid.

31404

The OU does not acquire the application.

31408

The codes or IDs of resources already exist.

31415

The number of resources reaches the limit.

Samples

Request Sample


url: /app-portal-service/v2.3/resource/create?orgId=your_org_ID

method: POST

{
  "type": "your_resource_type",
  "assignCodeToId": true,
  "resources": [
    {
      "code": "your_resource_code_1",
      "name": {
        "defaultValue": "your_resource_name_1",
        "i18nValue": {
          "zh_CN": "your_resource_name_zh_1",
          "en_US": "your_resource_name_en_1"
        }
      }
    },
    {
      "code": "your_resource_code_2",
      "name": {
        "defaultValue": "your_resource_name_2",
        "i18nValue": {
          "zh_CN": "your_resource_name_zh_2",
          "en_US": "your_resource_name_en_2"
        }
      }
    }
  ]
}

Return Sample


{
  "code": 0,
  "message": "OK",
  "data": {
    "success": true,
    "resources": [
      {
        "id": "your_resource_id_1",
        "code": "your_resource_code_1",
        "type": "your_resource_type_1",
        "name": {
          "defaultValue": "your_resource_name_1",
          "i18nValue": {
            "zh_CN": "your_resource_name_zh_1",
            "en_US": "your_resource_name_en_1"
          }
        }
      },
      {
        "id": "your_resource_id_2",
        "code": "your_resource_code_2",
        "type": "your_resource_type_2",
        "name": {
          "defaultValue": "your_resource_name_2",
          "i18nValue": {
            "zh_CN": "your_resource_name_zh_2",
            "en_US": "your_resource_name_en_2"
          }
        }
      }
    ]
  }
}