Schemas endpoints


Overview

The Directory REST API includes operations to list the schemas of all available objectClass objects and view schema details for specified objectClass entities.

Note: The PingDirectory Server ships with a default set of read-only schema files that define the core properties for the directory server.

Schema endpoint operations

The Directory REST API includes the following schema endpoints.

Endpoint Examples

Get all schemas

The GET /directory/v1/schemas endpoint returns a list of all configured objectClass entities on the server. If no objectClass entities are configured on the directory server, the request returns an empty list.

The following sample gets all configured schemas and their associated objectClass entities.

curl -X "GET" "https://ds.example.com/directory/v1/schemas" \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer jwtToken' \

The response data looks like this if at least one schema object is defined:

{
  "schemas": [
    {
      "$schema": "http://json-schema.org/draft-07/schema#23",
      "title": "top",
      "required": ["objectClass"],
      "classType": "abstract",
      "type": "object",
      "properties": {
        "objectClass": {
          "type": array,
          "items": {"type": "string"},
          "contains": {"const": "top"},
          "description": "Since 'top' is an abstract objectClass, new objects cannot be created with only 'top' as the objectClass value. A structural objectClass that derives from 'top' must be included"
        }
      },
      "additionalProperties": false,
      "_links": {
        "self": {
          "href": "https://localhost:5034/directory/v1/schemas/top"
        }
      }
    },
    {
      "$schema": "http://json-schema.org/draft-07/schema#23",
      "title": "person",
      ...
    },
    ...
  ],
  "_links": {
    "self: {
      "href": "https://localhost:5034/directory/v1/schemas"
    }
  }
}

The response data looks like this if there are no schemas configured on the directory server.

{
  "schemas": [],
  "_links": {
    "self: {
      "href": "https://localhost:5034/directory/v1/schemas"
    }
  }
}

Get the schema for a specified objectClass

The GET /directory/v1/schemas/{objectclass} endpoint returns the schema associated with the objectClass value of ubidPerson specified in the request URL.

curl -X "GET" "https://ds.example.com/directory/v1/schemas/ubidPerson" \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer jwtToken' \

The response data looks like this:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "ubidPerson",
    "classType": "structural",
    "parent": "top",
    "required": [
        "objectClass"
    ],
    "type": "object",
    "properties": {
        "objectClass": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "contains": {
                "const": "ubidPerson"
            },
            "description": "New objects of this type must include the 'ubidPerson' objectClass value. Returned entries will include the complete objectClass hierarchy: [top, ubidPerson]"
        },
        "audio": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "Octet String"
            }
        },
        "authPassword": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "Authentication Password Syntax"
            },
            "description": "password authentication information"
        },
        "businessCategory": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "Directory String"
            }
        },

        ...

    "additionalProperties": false,
    "_links": {
        "self": {
            "href": "https://127.0.0.1:2443/directory/v1/schemas/ubidPerson"
        },
        "parent": {
            "href": "https://127.0.0.1:2443/directory/v1/schemas/top"
        }
    }
}

Get operational attributes

The GET /directory/v1/schemas/_operationalAttributes endpoint returns a list of all operational attributes configured on the server.

curl -X "GET" "https://ds.example.com/directory/v1/schemas/_operationalAttributes" \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer jwtToken' \

The response data looks like this:

{
    "_operationalAttributes": {
        "aci": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "Sun-defined Access Control Information"
            },
            "description": "Sun-defined access control information attribute type"
        },
        "aclRights": {
            "type": "string",
            "readOnly": true,
            "description": "Sun-defined access control effective rights attribute type"
        },
        "aclRightsInfo": {
            "type": "string",
            "readOnly": true,
            "description": "Sun-defined access control effective rights information attribute type"
        },
        "administratorsAddress": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "IA5 String"
            }
        },
        "altServer": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "IA5 String"
            }
        },
        "attributeTypes": {
            "type": "array",
            "items": {
                "type": "string",
                "format": "Attribute Type Description"
            }
        },
        "baselineConfigurationDigest": {
            "type": "string"
        },
        "blockInheritance": {
            "type": "boolean",
            "readOnly": true
        },
        "changeTime": {
            "type": "string",
            "readOnly": true,
            "description": "the GMT time when the changelog entry was created"
        },
        "changelog-add-entry": {
            "type": "string",
            "format": "Octet String",
            "readOnly": true
        },
        "changelog-deleted-entry": {
            "type": "string",
            "format": "Octet String",
            "readOnly": true
        },


        ...
}