Custom Attributes
Custom attributes offer a seamless integration experience with our platform and can be managed through either the Solarize UI or the API Docs. The following entities support custom attributes:
- Site
- Customer
- Meter
- Meter Ownership
Values
To assign a custom attribute value to an entity, it is essential to create the corresponding custom attribute first. All custom attribute values are encapsulated within a customAttributes
object and can be utilized in POST
, UPDATE
, and GET
actions. Below is an example of an entity object with custom attributes:
{
"id": "a689a45d-2a05-425a-ba47-74434382fd3d",
...
"customAttributes": {
"aText": "Example Text",
"aNumber": 42.2,
"aDate": "2023-11-11",
"aNull": null
}
}
It's important to note that an entity always includes all custom attribute keys, even if no value has been added yet. The default value for an attribute is always null
.
Data types
Our platform supports a variety of data types, enhancing flexibility in your application. The following custom attribute types are supported:
Type | Example |
---|---|
text | "Example Text" |
number | 42.2 |
date | "2023-11-11" |
date_time | "2023-11-11T10:30:00.000Z" |
boolean | true |