Manage Applications

    Get template by name

    get
    https://api.box.com/2.0
    /metadata_templates/:scope/:template_key/schema

    Retrieves a metadata template by its scope and template name.

    Request

    application/json

    Path Parameters

    stringin pathrequired
    enterprise_27335

    The scope of the metadata template

    Value is one of "global", "enterprise_<id>"

    stringin pathrequired
    blueprintTemplate

    The name of the metadata template

    Response

    application/jsonMetadata Template

    Returns the metadata template matching the scope and template name.

    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/enterprise_27335/blueprintTemplate/schema \
         -H "Authorization: Bearer <ACCESS_TOKEN>"
    .NET
    BoxMetadataTemplate template = await client.MetadataManager
        .GetMetadataTemplate("enterprise", "marketingCollateral");
    Java
    MetadataTemplate template = MetadataTemplate.getMetadataTemplate(api, "templateName");
    Python
    template = client.metadata_template('enterprise', 'employeeRecord').get()
    print('The {0} template has {1} fields'.format(template.displayName, len(template.fields)))
    Node
    client.metadata.getTemplateSchema('enterprise', 'vcontract')
    	.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"
            }
          ]
        }
      ],
      "id": "f7a9891f"
    }