Use of the /Metadata Endpoint

You can use the /metadata endpoint to request a list of supported facts and dimension, or a list of filter and selection fields by fact/dimension. These fields and facts/dimensions can be used to create custom view templates.

This API supports the following query parameters:

Parameter

Description

realm

Required. The realm name.

documentType

Optional. If specified, the response contains only fields for the specified fact or dimension type. If not specified, the response contains fields for all fact/dimension types.

product

Required. Set value equal to analytics to limit results to fields relevant to the Analytical reporting API.

select

Optional. Specifies which fields in the output will be populated and which will be null. Relevant fields are documentType, filterFields, and selectFields.

Possible values of the select parameter are as follows:

documentType
returns a list of all supported document types. These are the suppored values of the documentType parameter.
filterFields
returns a list of supported filter fields for the fact/dimension type specified in the documentType parameter, or for all fact/dimension types if documentType is not specified. These fields can be used to create filters in the view template. See the filterExpressions element in View Template Structure
selectFields
returns a list of supported output fields for the fact/dimension type specified in the documentType parameter, or for all fact/dimension types if documentType is not specified. These are the fields that can be returned in the response to your API queries. See the selectAttributes view template element in View Template Structure.

includeCustomFields

Optional. Default value is false. When true, the response to the /metadata query includes custom fields.

includeFieldDescription

Optional. Default value is false. When true, the response to the /metadata query includes field descriptions for all returned fields. Field descriptions are returned as values of fieldDescription.

includeFieldName

Optional. Default value is false. When true, the response to the /metadata query includes field field labels for all returned fields. Field labels are returned as values of fieldName.

includePrimaryKeys

Optional. Boolean. When true, primary keys are included in the response. When false primary keys are omitted from the response. Default is false.

GET {{runtime_url}}/metadata?includePrimaryKeys={true|false}&realm=realm_name
                        

jsonSchema

Optional. Default value is false. The response to a /metadata query can be in either of two formats, which handle complex data structures such as objects in two different ways:

Flat JSON format
jsonSchema=false. The response contains a filterFields block, and a selectFields block. Complex data structures such as objects are not expanded, so only the object's name appears in the response at the same level as subfield names, with each comprising a single item in a flat list.
JSON Schema format
jsonSchema=true. The response contains a selectFields block, but no filterFields block. Complex data structures such as objects are expanded in nested blocks within the selectFields block to list their inner fields.
For example, in JSON Schema format, the selectionFields section of the response might list the Approver object as follows:
"Approver": {
	"type": [
		"object",
		"null"
		],
	"properties": {
		"UserId": {
			"title": "Approver.UserId",
			"type": [
				"string",
				"null"
				],
			"precision": null,
			"scale": null,
			"size": 50,
			"allowedValues": null,
			"fieldName": "Approver -> User ID",
			"fieldDescription": "User identification name or number"
			},
		"SourceSystem": {
			"title": "Approver.SourceSystem",
			"type": [
				"string",
				"null"
				],
			"precision": null,
			"scale": null,
			"size": 100,
			"allowedValues": null,
			"fieldName": "Approver -> Source System",
			"fieldDescription": "Source System"
			}
		}
	},
										

Notice that in the JSON Schema example above, Approver.SourceSystem is nested within Approver. In the Flat JSON format, these fields would appear at the same hierarchal level.

viewTemplateName

Optional. Restricts the output to include exactly the subset of the document schema that would be returned for the specified view template.