Register Resource


Register resources. A maximum of 1000 resources can be registered at one time.

Request Format


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

Request Parameters (URI)


Name

Location (Path/Query)

Required/Optional

Data Type

Description

orgId

Query

Required

String

OU ID. How to get orgId >>

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

resources

Required

Resources Struct

The list of resources to register. A maximum of 1000 resources can be registered at one time. Resources Request Structure >>

type

Required

String

The ID of resource type.

assignCodeTold

Optional

Boolean

Whether the resource ID is consistent with the resource code. The following values ​​are supported:

  • true indicates consistency.

  • false indicates inconsistency.

The default value is false.

Resources Request Structure


Name

Data Type

Description

code

String

The resource code.

name

Object

The resource name, supports internationalization. Internationalized name structure >>

Response Parameters


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 >>

Resources Return Struct


Name

Data Type

Description

id

String

Resource ID.

code

String

Resource code.

name

Object

Resource name in multiple languages.

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 obtain 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"
          }
        }
      }
    ]
  }
}