Squarebox

Custom Objects API

The CatDV REST API provides the ability to define custom objects, which can then be manipulated via the REST API just as if they were built-in objects. Custom Objects have many uses, but perhaps the most common is as a way of storing static data (for example team play rosters) that can be used to populated UI elements such as calculated picklists, or drive logic in worker actions.

Endpoint: / objectclasses

Represents the collection of all the object ‘classes’ (different types of objects) defined on the server. Note this includes both built-in object classes, such as clip, catalog etc. plus any custom object classes that have been defined.

New, custom object classes are defined by adding (POSTing) a new ObjectClass to the endpoint. To add user-defined fields to the the newly defined object class it is necessary to create a corresponding Field Group, which is done by POSTing to the /fieldgroups endpoint and specifying the ‘identifier’ of the newly created custom object class in the ‘objectClass’ property of the FieldGroup Object. You can then add any number of user-defined fields added to it by POSTing to the /fields endpoint and again specifying the ‘identifier’ of the newly created custom object class in the ‘memberOf’ property and the ID of the newly created field group in the fieldGroupID property of the field object.

Object Definitions

ObjectClass Object

Represents the fields to be displayed on the form (tab). Each Form Definition object contains the following fields

Field

Type

Description

ID

Integer

Unique ID of this ObjectClass.

name

String

Display name of this ObjectClass.

identifier

String

Unique identifier of the ObjectClass. By convention a string containing only lowercase letters and periods (.)

isBuiltIn

Boolean

True if this is a built-in object class e.g. clip, catalog etc.. False if this is a custom object class.

Operations

GET /objectclasses

Returns an array of all the Object Classes defined on the server.

GET / objectclasses /< objectclass _id>

Returns the Object Class with the specified id.

POST / objectclasses

Define a new Object Class in the system. POST data contains JSON ObjectClass object. Returns the newly created Object Class.

PUT / objectclasses /< objectclass_id >

Update the Object Class specified by < objectclass _id> with the values in the JSON ObjectClass object passed in the PUT data. Only fields present in the passed in JSON ObjectClass object will be updated.

DELETE / objectclasses /< objectclass_id>

Delete the Object Class specified by < objectclass _id>.

Endpoint: / objects

Represents the collection of all the custom object defined on the server.

Object Definitions

CustomObject Object

Represents the fields to be displayed on the form (tab). Each Form Definition object contains the following fields

Field

Type

Description

ID

Integer

Unique ID of this ObjectClass.

objectClass

String

Identifier of the object class to which this object belongs

name

String

Display name of this CustomObject.

createdDate

DateTime

Date/time this object was created

lastModifiedDate

DateTime

Date/time this object was last modified

fields

Object

JSON Object containing all the user-defined fields that have values for this custom object

Operations

GET /objects[?objectClass=<object_class>][&query=<query>][&select=<include>]…

Returns an array of all the Customer Objects defined on the server.

URL Parameter

Type

Description

objectClass

String

Identifier of the object class that returned objects should belong to.

query

Query

Retrieve custom objects that match the provided query. For more information about the syntax of the query parameter see section “Query Filter Syntax”.

select

String

Specifies a single field that will be selected from each object of the result set. When specified the GET call returns a simple array containing just that field. This is particularly useful for populating calculated picklists.

GET / objects /< object _id>

Returns the Custom Object with the specified id.

POST / objects

Create a new Custom Object. POST data contains JSON Custom Object object. Returns the newly created Custom Object.

PUT / objects /< object_id >

Update the Custom Object specified by < object _id> with the values in the JSON Custom Object object passed in the PUT data. Only fields present in the passed in JSON Custom Object object will be updated.

DELETE / objects /< object_id>

Delete the Custom Object specified by < object _id>.