Custom Attributes
Core API provides a mechanism for extending Tulip business data objects to reflect client-side specifics through custom attributes. These are general-purpose extensions to objects in the Tulip data model. They consist of two parts: attributes and attribute values, and are used to construct key-value pairs that can be attached to clients' business data records on the Tulip platform. Certain attributes are provided for business data objects out of the box as well.
Using Custom Attributes
Creating attributes and setting values follow the EAV (entity-attribute-value) pattern as described in the steps below:
- Create the keys of a new key/value pair to make that attribute available for a particular resource.This is done by making a POST call to an attribute’s
crm/{resource}Attribute
endpoint. For example, if you wanted to create attributes for a Customer object, you would use the following endpoint:/crm/customerAttributes
When creating attributes you can provide the following fields:
Field | Type | Description | Required |
---|---|---|---|
externalId | string | Unique identifier of the attribute | Y |
type | string | Type of the attribute value: string | N |
description | string | Description of the attribute | N |
- Now that you have created the attribute entity, you are now able to assign this attribute to a record and the value associated to that record via the attributeValues field, using the
POST
orPUT
call for the record.
For example: POST
or PUT
to crm/customers
to access the attributes
field which is nested inside the Customers object record.
The following fields are available when you are setting attribute values for the record:
Field | Type | Description | Required |
---|---|---|---|
value | string | The value for the attribute. | Y |
attributeExternalId | string | Unique identifier of the attribute value | Y |
languageExternalId | string | Attribute values can be localized through this field to provide language context (need to create document for Localized Values). | N (Optional) |