GET Metadata Fields

The GET /MetadataFields operation returns details of the custom certificate metadataClosed Metadata provides information about a piece of data. It is used to summarize basic information about data, which can make working with the data easier. In Keyfactor Command, the certificate metadata feature allows you to create custom metadata fields that allow you to tag certificates with tracking information about certificates. fields defined in Keyfactor Command. Query parameters support filtering using defined criteria, control over pagination by specifying the page number and return limit, and customization of sorting based on specified fields and order. On success, the operation returns HTTP 200 OK with  details for the metadata fields.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:

/metadata/types/read/

Table 569: GET Metadata Fields Input Parameters

Name In Description
QueryString Query

A string containing a query to limit the results (for example, field1 -eq value1 AND field2 -gt value2). The default is to return all records. For querying guidelines, refer to: Using Search in the Management Portal. The query fields supported for this operation are:

  • Name
PageReturned Query An integer that specifies how many multiples of the returnLimit to skip and offset by before returning results, to enable paging. The default is 1.
ReturnLimit Query An integer that specifies how many results to return per page. The default is 50. Very large values can result in long processing time.
SortField Query

A string containing the property by which the results should be sorted. Fields available for sorting through the API include:

  • AllowAPI

  • CaseSensitive

  • DataType

  • DefaultValue

  • Description

  • DisplayOrder

  • Enrollment

  • ExemptFromActionedCount

  • ExplicitUpdate

  • Hint

  • Id

  • Message

  • Name

  • Options

  • Validation

Available sort fields are affected by the query provided in QueryString. The default sort field is DisplayOrder.

SortAscending Query An integer that sets the sort order on the returned results. A value of 0 sorts results in ascending order while a value of 1 sorts results in descending order. The default is ascending.

Table 570: GET Metadata Fields Response Data

Name Description
ID An integer indicating the Keyfactor Command reference ID for the metadata field. This ID is automatically set by Keyfactor Command.
Name A string indicating the name of the metadata field. This name appears in interfaces where you can use metadata, such as certificate details dialogs, alert dialogs, certificate imports and certificate requests. Once this field has a value associated with it for at least one certificate, you cannot change this name. The metadata name field cannot contain spaces. Dashes and underscores are supported.
Description A string indicating the description for the metadata field.
DataType

An integer indicating the data type of the metadata field. ClosedShow data type details.

Hint

A string indicating a short hint for the metadata field. This hint appears in unpopulated metadata string, integer, big text, and date fields on editing interfaces to provide the user with a clue as to what type of data should be entered in the field.

This field is only supported for metadata fields with data types string, integer, date or big text.

Validation A string containing a regular expression against which data entered in a string field will be validated. When a user enters information in a metadata field that does not match the specified regular expression, he or she will see the warning message specified in the Message field. For example:
^[a-zA-Z0-9'_\.\-]*@(keyexample\.org|keyexample\.com)$

This regular expression specifies that the data entered in the field must consist of some number of characters prior to the @ made up only of lowercase letters, uppercase letters, numbers, apostrophes, underscores, periods, and/or hyphens followed by exactly either @keyexample.org or @keyexample.com.

This field is only supported for metadata fields with data type string.

Tip:  If a value is set for a given metadata field at either the template or enrollment pattern level, these take precedence over the system-wide settings in PFX and CSR enrollment requests as follows:
  • Enrollment pattern default exists: The enrollment pattern value is used.

  • Template-level default exists and enrollment pattern value is unset: The template-level default value is used. This is the template specified as the default for the enrollment pattern if the request uses an enrollment pattern.

  • Neither template nor enrollment pattern has a default value defined: The corresponding system-wide default value, if defined, is used.

Enrollment

An integer indicating how metadata fields should be handled on the PFX and CSR Enrollment pages. ClosedShow enrollment details.

Tip:  If a value is set for a given metadata field at either the template or enrollment pattern level, these take precedence over the system-wide settings in PFX and CSR enrollment requests as follows:
  • Enrollment pattern default exists: The enrollment pattern value is used.

  • Template-level default exists and enrollment pattern value is unset: The template-level default value is used. This is the template specified as the default for the enrollment pattern if the request uses an enrollment pattern.

  • Neither template nor enrollment pattern has a default value defined: The corresponding system-wide default value, if defined, is used.

Message

A string containing a message to present when a user enters information in a metadata field that does not match the specified regular expression (Validation field).

Tip:  If a value is set for a given metadata field at either the template or enrollment pattern level, these take precedence over the system-wide settings in PFX and CSR enrollment requests as follows:
  • Enrollment pattern default exists: The enrollment pattern value is used.

  • Template-level default exists and enrollment pattern value is unset: The template-level default value is used. This is the template specified as the default for the enrollment pattern if the request uses an enrollment pattern.

  • Neither template nor enrollment pattern has a default value defined: The corresponding system-wide default value, if defined, is used.

Options

An array containing a comma separated list of values that should appear in the field dropdown for multiple choice fields.

This field is only supported for metadata fields with data type multiple choice.

DefaultValue

A string containing a default value with which to pre-populate the metadata field for new certificate requests made using PFX or CSR enrollment. Data type of Email will accept a comma separated list of email addresses (limit 100 characters per email address).

This field is only supported for metadata fields with data types string, integer, Boolean, Email or multiple choice.

Tip:  If a value is set for a given metadata field at either the template or enrollment pattern level, these take precedence over the system-wide settings in PFX and CSR enrollment requests as follows:
  • Enrollment pattern default exists: The enrollment pattern value is used.

  • Template-level default exists and enrollment pattern value is unset: The template-level default value is used. This is the template specified as the default for the enrollment pattern if the request uses an enrollment pattern.

  • Neither template nor enrollment pattern has a default value defined: The corresponding system-wide default value, if defined, is used.

AllowAPI

This is considered deprecated and may be removed in a future release.

ExplicitUpdate

This is considered deprecated and may be removed in a future release.

DisplayOrder An integer indicating the order in which the metadata field should be displayed on pages where the metadata fields are displayed (for example, PFX enrollment, certificate details).
CaseSensitive

A Boolean that indicates whether regular expression Validation for string metadata fields is case-sensitive. When turned on, this setting overrides any case-sensitivity defined in the regular expression. If the input does not match the expected case, the configured validation Message is displayed. The default is False.

Tip:  If a value is set for a given metadata field at either the template or enrollment pattern level, these take precedence over the system-wide settings in PFX and CSR enrollment requests as follows:
  • Enrollment pattern default exists: The enrollment pattern value is used.

  • Template-level default exists and enrollment pattern value is unset: The template-level default value is used. This is the template specified as the default for the enrollment pattern if the request uses an enrollment pattern.

  • Neither template nor enrollment pattern has a default value defined: The corresponding system-wide default value, if defined, is used.