Asset Types
Definition
Every Asset has an Asset Type, which describes the properties an Asset can have along with the valid values for those properties.
These properties can be simple values like strings, numbers, or dates. They can also be complex values or references to other Assets or other types of things, like Users or videos.
Attributes
Asset Types have the following attributes:
- id - The Asset Type ID.
- createdAt - The date and time a User created the Asset Type.
- updatedAt - The last date and time a User updated the Asset Type.
- creator - The User who created the Asset Type.
- account - The Account where this Asset Type is used.
- name - The name of the Asset Type. This doesn’t need to be unique.
- fields - This attribute describes the properties of the Asset Type. It is a complex object inspired by JSON schema but with significant differences. It’s primarily for use by Unearth clients because it provides important information and a more convenient format than the schema attribute.
- schema - This attribute provides a JSON schema which a User can use to validate the properties of an Asset. The value of the schema attribute is used internally when validating the creation or modification of Assets. This is generated from the “fields” attribute.
Asset Type Fields
An Asset Type can have the following fields:
Field | Type | Use |
---|---|---|
comment | string | Comment-specific text field |
string | string | Generic text field |
boolean | boolean | Boolean value |
datetime | number | timestamp in numeric format |
date | numer | timestamp in numeric format |
area | number | Area-specific numeric value |
attachments | object | attachment-specific object |
text | string | text field |
number | number | numeric field |
length | number | numeric field |
name | string | Asset Name (treated separately from other text fields) |
mediaId | string | media reference |
paragraph | string | longer text field |
volume | number | volume-specific numeric field |
geometry | object | asset geometry reference (point/line/ploygon) |
object | object | generic object field |
objRef | string | reference to another Unearth asset |
array | array | generic array field |
enum | string | one of a set of text values |
How to use Asset Types
Through the UI
Asset Type names are the only thing that can be edited through the UI, via the Data Center you can see all your asset types and modify the name.
Through the API
While creating Asset Types isn’t exposed publicly, you can retrieve Asset Types from the API directly, as an attribute on an Asset, or on an Asset’s form.
Updated almost 2 years ago