メインコンテンツへスキップ
POST
/
metadata_templates
/
schema#classifications
最初の分類を追加
curl -i -X POST "https://api.box.com/2.0/metadata_templates/schema" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "templateKey": "securityClassification-6VMVochwUWo",
       "scope": "enterprise",
       "displayName": "Classification",
       "hidden": false,
       "copyInstanceOnItemCopy": true,
       "fields": [
         {
           "type": "enum",
           "key": "Box__Security__Classification__Key",
           "displayName": "Classification",
           "hidden": false,
           "options": [
             {
               "key": "Classified",
               "staticConfig": {
                 "classification": {
                   "colorID": 7,
                   "classificationDefinition": "Top Seret"
                 }
               }
             }
           ]
         }
       ]
     }'
{
  "id": "58063d82-4128-7b43-bba9-92f706befcdf",
  "type": "metadata_template",
  "scope": "enterprise_123456",
  "templateKey": "securityClassification-6VMVochwUWo",
  "displayName": "Classification",
  "fields": [
    {
      "id": "822227e0-47a5-921b-88a8-494760b2e6d2",
      "type": "enum",
      "key": "Box__Security__Classification__Key",
      "displayName": "Classification",
      "options": [
        {
          "id": "46aea176-3483-4431-856c-6b5b13d1cc50",
          "key": "Sensitive",
          "staticConfig": {
            "classification": {
              "classificationDefinition": "Sensitive information",
              "colorID": 4
            }
          }
        }
      ],
      "hidden": false
    }
  ],
  "hidden": false,
  "copyInstanceOnItemCopy": true
}
このリソースは、バージョン2024.0のエンドポイントで使用されています。 詳細については、 Box APIのバージョン管理を参照してください。Box SDKのバージョニング戦略について詳しく学ぶ。」

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
scope
enum<string>
required

分類を作成するスコープ。これには、enterpriseまたはenterprise_{id} (idは会社の一意のID) を指定する必要があります。

利用可能なオプション:
enterprise
Example:

"enterprise"

templateKey
enum<string>
required

メタデータテンプレートのリストを定義します。

利用可能なオプション:
securityClassification-6VMVochwUWo
Example:

"securityClassification-6VMVochwUWo"

displayName
enum<string>
required

ウェブインターフェースおよびモバイルインターフェースに表示されるテンプレートの名前。

利用可能なオプション:
Classification
Example:

"Classification"

fields
object[]
required

分類テンプレートにはフィールドが1つだけ必要で、このフィールドでは、有効な分類の値がすべて保持されます。

hidden
boolean

分類テンプレートをウェブおよびモバイルデバイスで非表示にするか使用可能にするかを決定します。

Example:

false

copyInstanceOnItemCopy
boolean

ファイルまたはフォルダをコピーするときに分類もコピーするかどうかを決定します。

Example:

false

Response

新しいsecurityClassificationメタデータテンプレートを返します。これには、この会社が使用できるすべての分類のリストを取得するBox__Security__Classification__Keyフィールドが含まれています。

会社が定義したセキュリティ分類を保持するメタデータテンプレート。

id
string
required

分類テンプレートのID。

Example:

"58063d82-4128-7b43-bba9-92f706befcdf"

type
enum<string>
required

値は常にmetadata_templateになります。

利用可能なオプション:
metadata_template
Example:

"metadata_template"

scope
string
required

分類テンプレートのスコープ。これはenterprise_{id}形式 (idはEnterprise ID) になります。

Example:

"enterprise_123456"

templateKey
enum<string>
required

値は常にsecurityClassification-6VMVochwUWoになります。

利用可能なオプション:
securityClassification-6VMVochwUWo
Example:

"securityClassification-6VMVochwUWo"

displayName
enum<string>
required

ウェブインターフェースおよびモバイルインターフェースに表示されるこのテンプレートの名前。

利用可能なオプション:
Classification
Example:

"Classification"

fields
object[]
required

この分類テンプレートのフィールドのリスト。これには、Box__Security__Classification__Keyというフィールドが1つだけ含まれています。これにより、この会社で使用できるさまざまな分類が定義されます。

Required array length: 1 element
hidden
boolean

このテンプレートを常にウェブインターフェースおよびモバイルインターフェースで使用可能にするかどうかを決定します。

Example:

false

copyInstanceOnItemCopy
boolean

ファイルまたはフォルダをコピーするときに分類もコピーするかどうかを決定します。

Example:

true