Skip to main content

Content

Attribute supports various content defined by contentType.

Attribute types

For more details about Attribute types and contentType, see Attributes.

Content properties

Each content type must extends BaseAttributeContent which is abstracted from AttributeContent.

The content has the following properties defined and inherited from BaseAttributeContent:

PropertyTypeShort descriptionRequired
referencestringReference that can be used for the content value. It is usefull especially when the data contains an object, or any other more complex data structureNo
dataAttributeContentThe value of the content, depending on the contentType from supported AttributeContentTypeYes

Supported content types

Supported content types are defined in AttributeContentType. The following content types are available and supported:

AttributeContentTypeClassData
STRINGStringAttributeContentstring
INTEGERIntegerAttributeContentinteger
SECRETSecretAttributeContentSecretAttributeContentData
FILEFileAttributeContentFileAttributeContentData
BOOLEANBooleanAttributeContentboolean
TEXTTextAttributeContentstring
CODEBLOCKCodeBlockAttributeContentCodeBlockAttributeContentData
FLOATFloatAttributeContentfloat
DATEDateAttributeContentdate
DATETIMEDateTimeAttributeContentdatetime
TIMETimeAttributeContenttime
CREDENTIALCredentialAttributeContentCredentialDto
OBJECTObjectAttributeContentobject
Mulitple content types in one Attribute

One Attribute can define only one contenttype. Multiple different content types for one Attribute is not supported.

Content type samples

The table below shows the AttributeContentType and the sample for each type.

AttributeContentType

Associated content field

STRING

{  
"content": [
{
"reference": "string",
"data": "string"
}
]
}

INTEGER

{  
"content": [
{
"reference": "string",
"value": 12345
}
]
}

SECRET

{  
"content": [
{
"reference": "string",
"data": {
"secret": "secret"
}
]
}

SECRET is handled by the platform in a secure way and its value will never be presented to client once defined.

FILE

{  
"content": [
{
"reference": "string",
"data": {
"value": "base64-encoded content of the file",
"fileName": "name of the file",
"mimeType": "type of the file"
}
}
]
}

FILE type can be specifically handled based on the mimeType.

BOOLEAN

{  
"content": [
{
"reference": "string",
"value": true
}
]
}

CREDENTIAL

{
"content": [
{
"reference": "identification of Credential",
"data": {
"name": "string",
"uuid": "UUID of the Credential",
"kind": "kind of the Credential",
"attributes": [
...list of Credential Attributes
]
"enabled": true,
"connectorUuid": "UUID of the Credential Provider Connector",
"connectorName": "name of the Credential Provider Connector"
}
}
]
}

CREDENTIAL is a special purpose type that is handled by the platform for Connectors that needs to use the credential for authentication and authorization to technology, for example API Key, username/password, and any other Credential.

DATE

{
"content": [
{
"reference": "string",
"value": "2022-11-30"
}
]
}

DATE should be in the format yyyy-MM-dd.

FLOAT

{
"content": [
{
"reference": "string",
"value": 12.4487211
}
]
}

OBJECT

{
"content": [
{
"reference": "identification of Object",
"data": {
... any JSON object
}
}
]
}

OBJECT type provides a flexible way how to work with the custom objects within the Attributes and Callbacks.

TEXT

{
"content": [
{
"reference": "string",
"value": "long text"
}
]
}

TEXT supports long string/text data to be processed.

CODEBLOCK

{
"content": [
{
"reference": "string",
"value": {
"language": "string",
"code": "Block of the code in Base64. Formatting of the code is specified by variable language"
}
}
]
}

CODEBLOCK supports scripts from various languages. For example, to store simple addition method written in C#

public void Add(string a, string b) {
return a + b;
}

you would sent following content

{
"content": [
{
"reference": "sample",
"value": {
"language": "csharp",
"code": "cHVibGljIHZvaWQgQWRkKHN0cmluZyBhLCBzdHJpbmcgYikgewogIHJldHVybiBhICsgYjsKfQ=="
}
}
]
}

TIME

{
"content": [
{
"reference": "string",
"value": "11:45:32"
}
]
}

TIME should be in the format HH:mm:ss.

DATETIME

{
"content": [
{
"reference": "string",
"value": "2011-12-03T10:15:30+01:00"
}
]
}

DATETIME should be in the format yyyy-MM-dd'T'HH:mm:ss.SSSXXX, which is ISO-8601 extended offset date-time format.

Content model

The following diagram represents the content model inherited from the AttributeContent. Details can be found in the CZERTAINLY Interfaces repository.