All data in Zaius is stored within collections called Objects (what many think of as a database table).
Objects are composed of Fields.
Fields link objects together via Relations.
Object Definition{"name": "object_name","display_name": "Display Name","alias": "object_alias","fields": [],"relations": []}
property | description |
name | plural name for the object |
display_name | user-friendly name shown within Zaius |
alias | singular name for the object |
fields | collection of |
relations | collection of |
{"name": "objects","display_name": "Object","alias": "object","fields": [{"name": "object_id","display_name": "New Object Identifier","type": "string","primary": true},{"name": "another_field","display_name": "Another Fields","type": "string"},{"name": "child_id","display_name": "Child Identifier","type": "number"}],"relations": [{"name": "my_relation","display_name": "My Relationship","child_object": "child","join_fields": [{"parent": "child_id","child": "child_id"}]}]}
{"title": "Bad Request","status": 400,"timestamp": "2018-08-07T13:44:17.659Z","detail": {"invalids": [{"field": "name","reason": "already used by another object"},{"field": "alias","reason": "already used by another object"},{"field": "display_name","reason": "already used by another object"},{"field": "fields","reason": "at least one primary key field required"},{"field": "relations[0].child_object","reason": "does not exist"}]}}
Example Payload{"name": "objects","display_name": "Object","alias": "object","fields": [{"name": "object_id","display_name": "New Object Identifier","type": "string","primary": true},{"name": "another_field","display_name": "Another Fields","type": "string"},{"name": "child_id","display_name": "Child Identifier","type": "number"}],"relations": [{"name": "my_relation","display_name": "My Relationship","child_object": "child","join_fields": [{"parent": "child_id","child": "child_id"}]}]}
[{"name": "tickets","display_name": "Tickets","alias": "ticket","fields": [{"name": "field_name","type": "number","display_name": "Display Name","primary": true}],"relations": [{"name": "my_relation","display_name": "My Relationship","child_object": "target_object_name","join_fields": [{"parent": "child_id","child": "child_id"}]}]},{"name": "concerts","display_name": "Concerts","alias": "concert","fields": [{"name": "field_name","type": "number","display_name": "Display Name","primary": true}],"relations": [{"name": "my_relation","display_name": "My Relationship","child_object": "target_object_name","join_fields": [{"parent": "child_id","child": "child_id"}]}]}]
curl -iX GET \'https://api.zaius.com/v3/schema/objects' \-H 'x-api-key: example.apiKey'
{"name": "tickets","display_name": "Tickets","alias": "ticket","fields": [{"name": "field_name","type": "number","display_name": "Display Name","primary": true}],"relations": [{"name": "my_relation","display_name": "My Relationship","child_object": "target_object_name","join_fields": [{"parent": "child_id","child": "child_id"}]}]}
curl -iX GET \'https://api.zaius.com/v3/schema/objects/myobject' \-H 'x-api-key: example.apiKey'
{"name": "field_name","type": "number","auto": true,"display_name": "Display Name","description": "Description of field","created_by": "zaius","primary_key": true}
property | description |
name | name of the field |
type | field data type. options are |
auto | (read only) marks the field as one that is auto populated by Zaius |
display_name | the user-friendly name used within Zaius |
description | description of the field |
created_by | (read only) specifies what/who created the field. current values as |
primary_key | marks the field as identifying for the containing object. only allowed during object creation. |
number
, timestamp
, string
, boolean
{"name": "field_name","display_name": "Display Name","description": "Description of field","type": "number"}
{"title": "Bad Request","status": 400,"timestamp": "2018-08-07T13:44:17.659Z","detail": {"invalids": [{"field": "name","reason": "already exists"}}}
Example Payload{"name": "field_name","type": "number","display_name": "Display Name","description": "Description of field"}
If you are attempting to create an identifier (e.g. an address for messaging or an internal reference to a customer record similar to an email, phone number or token), refer to the Identifier API documentation:
[{"name": "object_id","display_name": "New Object Identifier","type": "string","created_by" "account","primary": true},{"name": "another_field","display_name": "Another Fields","type": "string","created_by" "account"},{"name": "child_id","display_name": "Child Identifier","type": "number","created_by" "account"}]
Example Payload{"name": "my_relation","display_name": "My Relationship","child_object": "child","join_fields": [{"parent": "child_id","child": "child_id"}]}
curl -iX GET \'https://api.zaius.com/v3/schema/objects/{object_name}/fields' \-H 'x-api-key: example.apiKey'
{"name": "field_name","type": "number","display_name": "Display Name","auto": true,"description": "The venue that the user visisted.","created_by" "zaius",}
curl -iX GET \'https://api.zaius.com/v3/schema/objects/{object_name}/fields/{field_name}' \-H 'x-api-key: example.apiKey'
Representation describing a relationship between two objects. The Object
containing the Relation
definition is the parent
object.
{"name": "relation_name","display_name": "Relation Display Name","child_object": "child_object_name","join_fields": [{"parent": "child_id","child": "child_id"}]}
property | description |
name | name for the relation |
display_name | user-friendly name shown within Zaius |
child_object | child |
join_fields | collection of |
{"name": "my_relation","display_name": "My Relationship","child_object": "child","join_fields": [{"parent": "child_id","child": "child_id"}]}
{"title": "Bad Request","status": 400,"timestamp": "2018-08-14T12:23:04.500Z","detail": {"invalids": [{"field": "join_fields[0].parent","reason": "does not match child data type"}]}}
[{"name": "my_relation","display_name": "My Relationship","child_object": "child","join_fields": [{"parent": "child_id","child": "child_id"}]},{"name": "my_relation2","display_name": "My Relationship 2","child_object": "child","join_fields": [{"parent": "child_id","child": "child_id"}]}]
curl -iX GET \'https://api.zaius.com/v3/schema/objects/{object_name}/relations' \-H 'x-api-key: example.apiKey'
{"name": "my_relation","display_name": "My Relationship","child_object": "target_object_name","join_fields": [{"parent": "child_id","child": "child_id"}]}
curl -iX GET \'https://api.zaius.com/v3/schema/objects/{object_name}/relations/{relation_name}' \-H 'x-api-key: example.apiKey'