すべてのグローバルメタデータテンプレートのリストを取得

get
https://api.box.com/2.0
/metadata_templates/global

Boxを使用するすべての会社が利用できる、すべての汎用グローバルメタデータテンプレートを取得する場合に使用します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

クエリパラメータ

integer / int64クエリ内省略可能
10001000

返す項目の1ページあたりの最大数。

stringクエリ内省略可能
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

結果が返される開始位置のマーカー。マーカーベースのページ割りを使用している場合に使用されます。

これを使用するには、usemarkertrueに設定する必要があります。

レスポンス

すべての会社とそれに対応するスキーマで使用できるすべてのメタデータテンプレートを返します。

リクエストパラメータが無効な場合に返されます。

予期しないクライアントエラー。

get
すべてのグローバルメタデータテンプレートのリストを取得
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -i -X GET "https://api.box.com/2.0/metadata_templates/global" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxEnterpriseMetadataTemplateCollection<BoxMetadataTemplate> templates = await client.MetadataManager
    .GetEnterpriseMetadataAsync("global");
Java
Iterable<MetadataTemplate> templates = MetadataTemplate.getEnterpriseMetadataTemplates('global', api);
for (MetadataTemplate templateInfo : templates) {
    // Do something with the metadata template.
}
Python
templates = client.get_metadata_templates(scope='global)
for template in templates:
    print(f'Metadata template {template.templateKey} is in global scope')
Node
client.metadata.getTemplates('global')
	.then(templates => {
		// ...
	});
iOS
let iterator = client.metadata.listEnterpriseTemplates(scope: "global")
iterator.next { results in
    switch results {
    case let .success(page):
        for template in page.entries {
            print("Template name: \(template.displayName)")
        }

    case let .failure(error):
        print(error)
    }
}

レスポンスの例

{
  "entries": [
    {
      "id": "58063d82-4128-7b43-bba9-92f706befcdf",
      "type": "metadata_template",
      "scope": "enterprise_123456",
      "templateKey": "productInfo",
      "displayName": "Product Info",
      "hidden": true,
      "fields": [
        {
          "type": "string",
          "key": "category",
          "displayName": "Category",
          "description": "The category",
          "hidden": true,
          "options": [
            {
              "key": "Category 1",
              "id": "45dc2849-a4a7-40a9-a751-4a699a589190"
            }
          ],
          "id": "822227e0-47a5-921b-88a8-494760b2e6d2"
        }
      ],
      "copyInstanceOnItemCopy": true
    }
  ],
  "limit": 1000,
  "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
  "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}