Schemas

You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see Custom User Fields.

For a list of methods for this resource, see the end of this page.

Resource representations

JSON template for Schema resource in Directory API.

{
  "kind": "admin#directory#schema",
  "schemaId": string,
  "etag": etag,
  "schemaName": string,
  "displayName": string,
  "fields": [
    {
      "kind": "admin#directory#schema#fieldspec",
      "fieldId": string,
      "etag": etag,
      "fieldType": string,
      "fieldName": string,
      "displayName": string,
      "multiValued": boolean,
      "readAccessType": string,
      "indexed": boolean,
      "numericIndexingSpec": {
        "minValue": double,
        "maxValue": double
      }
    }
  ]
}
Property name Value Description Notes
displayName string Display name for the schema. writable
etag etag The ETag of the resource.
fields[] list A list of fields in the schema. writable
fields[].displayName string Display Name of the field. writable
fields[].etag etag The ETag of the field.
fields[].fieldId string The unique identifier of the field (Read-only)
fields[].fieldName string The name of the field. writable
fields[].fieldType string The type of the field.


Acceptable values are:
  • "BOOL": Boolean values.
  • "DATE": Dates in ISO-8601 format.
  • "DOUBLE": Double-precision floating-point values.
  • "EMAIL": Email addresses.
  • "INT64": 64-bit integer values.
  • "PHONE": Phone numbers.
  • "STRING": String values.
writable
fields[].indexed boolean Boolean specifying whether the field is indexed or not. Default: true. writable
fields[].kind string The kind of resource this is. For schema fields this is always admin#directory#schema#fieldspec.
fields[].multiValued boolean A boolean specifying whether this is a multi-valued field or not. Default: false. writable
fields[].numericIndexingSpec object Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the numericIndexingSpec allows range queries to be supported. writable
fields[].numericIndexingSpec.maxValue double Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant. writable
fields[].numericIndexingSpec.minValue double Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant. writable
fields[].readAccessType string Specifies who can view values of this field. See Retrieve users as a non-administrator for more information.

Note: It may take up to 24 hours for changes to this field to be reflected.

Acceptable values are:
  • "ADMINS_AND_SELF"
  • "ALL_DOMAIN_USERS"
writable
kind string The type of API resource. For Schema resources, this is always admin#directory#schema.
schemaId string The unique identifier of the schema (Read-only)
schemaName string The schema's name. writable

Methods

delete
Delete schema
get
Retrieve schema
insert
Create schema.
list
Retrieve all schemas for a customer
patch
Update schema. This method supports patch semantics.
update
Update schema

Enviar comentarios sobre…

¿Necesitas ayuda? Visita nuestra página de asistencia.