Get a template by ID

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

Retrieves a metadata template by its ID.

Request

application/json

Path Parameters

stringin pathrequired
f7a9891f

The ID of the template

Response

application/jsonMetadata Template

Returns the metadata template that matches the ID.

You can now try out some of our APIs live, right here in the documentation.
Log In

Request Example

cURL
curl -X GET https://api.box.com/2.0/metadata_templates/f7a9891f \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxMetadataTemplate template = await client.MetadataManager
    .GetMetadataTemplateById("17f2d715-6acb-45f2-b96a-28b15efc9faa");
Java
MetadataTemplate template = MetadataTemplate.getMetadataTemplateByID(api, "37c0204b-3fe1-4a32-b9da-f28e88f4c4c6");
Python
template = client.metadata_template_by_id(template_id='abcdef-fba434-ace44').get()
print('The {0} template has {1} fields'.format(template.displayName, len(template.fields)))
Node
client.metadata.getTemplateByID('17f2d715-6acb-45f2-b96a-28b15efc9faa')
	.then(template => {
		/* template -> {
			id: '17f2d715-6acb-45f2-b96a-28b15efc9faa',
			templateKey: 'vcontract',
			scope: 'enterprise_12345',
			displayName: 'Vendor Contract',
			hidden: true,
			fields: 
			[ { type: 'date',
				key: 'signed',
				displayName: 'Date Signed',
				hidden: false },
				{ type: 'string',
				key: 'vendor',
				displayName: 'Vendor',
				hidden: false },
				{ type: 'enum',
				key: 'fy',
				displayName: 'Fiscal Year',
				options: 
					[ { key: 'FY17' },
					{ key: 'FY18' },
					{ key: 'FY19' } ],
				hidden: false } ] }
		*/
	});

Response Example

{
  "scope": "enterprise_123456",
  "templateKey": "productInfo",
  "displayName": "Product Info",
  "hidden": true,
  "fields": [
    {
      "type": "string",
      "key": "category",
      "displayName": "Category",
      "description": "The category",
      "hidden": true,
      "options": [
        {
          "id": "f7a9895f",
          "key": "category1"
        }
      ]
    }
  ],
  "copyInstanceOnItemCopy": true,
  "id": "f7a9891f"
}