Child pages
  • SaveSchema

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

 

Apstratasummary

The SaveSchema API allows the Account Owner to create or update a Schema. Documents can be created based on the Schema to take advantage of the validation and security that the Schema offers.

Expand
titleWhat is a Schema?

Excerpt Include
Schemas
Schemas
nopaneltrue

 

See the Document Schema Definition or the Saved Query Schema Definition for all the schema options available.

A simple example schema:

Code Block
< schema >
     < aclGroups >
          < aclGroup name="admin" >
               < read >deviceA< /read >
               < write >userB< /write >
               < fields >
                    < field >fieldone< /field >
               < /fields >
          < /aclGroup >
          < aclGroup name="usersAndDevices" >
               < read >userC;deviceX< /read >
               < write >userD< /write >
               < fields >
                    < field >fieldtwo< /field >
               < /fields >
          < /aclGroup >
          < defaultAcl >
               < read >userA< /read >
               < write >userB< /write >
               < delete >userC< /delete >
          < /defaultAcl >
     < /aclGroups >
     < fields >
          < field name="fieldone" >
               < validation >
                    < regex >---regex validation---< /regex >
               < /validation >
          < /field >
          < field name="fieldtwo" type="numeric" searchable="true" >
               < validation >
                    < regex >thereg2< /regex >
                    < cardinality min="1" max="3" >< /cardinality >
                    < range min="1" max="3" >< /range >
               < /validation >
          < /field >
     < /fields >
< /schema >

 

...

(Refer to Common Request Parameters)

NameDescriptionRequiredDefaultPossible Values

apsdb.schemaName

Represents the full schema name that can consist of up to 5 folders and the schema file name separated by the character '/'.
e.g., application/provisioning/user/profile
In the example above the profile schema is saved under the three folders application > provisioning > user

Yes

 

The same set of rules applies to a schema name and a directory name:

  • Must begin with an alphabetic character.
  • Must end with an alphanumeric character or underscore (_).
  • Can contain alphanumeric characters, underscores (_) and periods (.).
  • Cannot have two or more consecutive periods.

Note: the full schema name including any folders must be minimum 3 characters and maximum 64 characters long.

apsdb.schema

Represents the schema xml (content)

No

  

apsdb.update

Should be set in order to update existing schema

No

  

apsdb.default

If apsdb.default is set to true, the parameter apsdb.schema should not be sent. If it is, an error occurs.

No

False

True

False

apsdb.newSchemaName

This is sent when the user wishes to rename the schema. Note that users are not allowed to rename a schema if there are documents using it.

No

  

 

Specific Response Elements

...