-
Notifications
You must be signed in to change notification settings - Fork 4
web sdk custom fields
Custom fields allow you to extend Security Center entities with additional properties specific to your business needs. This guide covers creating custom fields, reading/writing values, filtering by custom fields, and important limitations.
Custom fields are user-defined properties that can be added to Security Center entities. They allow you to store additional information beyond the standard entity properties.
Common use cases:
- Employee badge numbers
- Department codes
- Building access levels
- Training dates
- Equipment identifiers
- Custom business logic data
Custom fields support the following data types:
| Data Type | Description | Example Value | Notes |
|---|---|---|---|
Text |
String value | "Engineering" | Default empty string if not set |
Numeric |
Integer value | 12345 | Default 0 if not set |
Boolean |
True/false value | true | Default false if not set |
DateTime |
Date and time | "2025-01-15T10:30:00+08:00" | ISO 8601 format, supports timezone |
Date |
Date only | "2025-01-15" | No time component |
Decimal |
Decimal number | 99.99 | For currency or precise values |
Image |
Binary image data | Base64-encoded | Cannot be read via GET |
Entity |
Reference to another entity | GUID | Links to Security Center entity |
Creates a new custom field for the specified entity type.
Parameters:
-
entityType- Entity type (e.g., Cardholder, Credential, Door) -
customFieldName- Name of the custom field (no spaces or special characters) -
dataType- Data type (Text, Numeric, Boolean, DateTime, Date, Decimal, Image, Entity) -
defaultValue- Default value when not set (optional for Image and Entity types)
Examples:
POST /customField/Cardholder/DepartmentCode/Text/IT
POST /customField/Cardholder/BadgeNumber/Numeric/0
POST /customField/Cardholder/IsContractor/Boolean/false
POST /customField/Cardholder/LastTrainingDate/DateTime/DateTime.NowSpecial default values:
-
DateTime.Now- Current local time -
DateTime.UtcNow- Current UTC time
Response (success):
{
"Rsp": {
"Status": "Ok"
}
}Response (error - field already exists):
{
"Rsp": {
"Status": "Fail",
"Result": {
"SdkErrorCode": "TransactionFailed",
"Message": "The property Name is invalid. The property Name should be unique by EntityType, Owner and CustomEntityTypeId"
}
}
}There are two methods to read custom field values: dedicated endpoints and entity query syntax.
Retrieves the value of a specific custom field for an entity.
Example:
GET /customField/5ba791adf4a94efda6573779c198340a/DepartmentCodeResponse:
{
"Rsp": {
"Status": "Ok",
"Result": {
"Value": "Sales"
}
}
}Data type preservation:
- Text fields return strings:
"Value": "Engineering" - Numeric fields return numbers:
"Value": 12345 - Boolean fields return booleans:
"Value": true - DateTime fields return ISO 8601 strings:
"Value": "2025-01-15T10:30:00+08:00"
Custom fields can be queried like standard entity properties using the /entity endpoint.
Examples:
Read single custom field:
GET /entity?q=entity=5ba791adf4a94efda6573779c198340a,DepartmentCodeRead multiple custom fields:
GET /entity?q=entity=5ba791adf4a94efda6573779c198340a,DepartmentCode,BadgeNumber,IsContractorRead custom fields and standard properties:
GET /entity?q=entity=5ba791adf4a94efda6573779c198340a,Name,FirstName,LastName,DepartmentCode,BadgeNumberResponse:
{
"Rsp": {
"Status": "Ok",
"Result": {
"Name": "New_Cardholder_6225b1afcdf44f2798ccd531fd2d0320",
"FirstName": "Test",
"LastName": "User",
"DepartmentCode": "Sales",
"BadgeNumber": 12345
}
}
}There are two methods to set custom field values: dedicated endpoints and entity update syntax.
Sets the value of a specific custom field.
Examples:
PUT /customField/5ba791adf4a94efda6573779c198340a/DepartmentCode/Engineering
PUT /customField/5ba791adf4a94efda6573779c198340a/BadgeNumber/12345
PUT /customField/5ba791adf4a94efda6573779c198340a/IsContractor/true
PUT /customField/5ba791adf4a94efda6573779c198340a/LastTrainingDate/2025-01-15T10:30:00Value conversion:
- Text: Any string value
- Numeric: Integer string (e.g., "12345")
- Boolean: "true" or "false" (case-insensitive)
- DateTime: ISO 8601 string, or "DateTime.Now", or "DateTime.UtcNow"
- Decimal: Decimal string (e.g., "99.99")
Response:
{
"Rsp": {
"Status": "Ok"
}
}Custom fields can be updated like standard entity properties using the /entity endpoint.
Examples:
Update single custom field:
POST /entity?q=entity=5ba791adf4a94efda6573779c198340a,DepartmentCode=SalesUpdate multiple custom fields:
POST /entity?q=entity=5ba791adf4a94efda6573779c198340a,DepartmentCode=Engineering,BadgeNumber=54321,IsContractor=falseUpdate custom fields and standard properties:
POST /entity?q=entity=5ba791adf4a94efda6573779c198340a,FirstName=Jane,DepartmentCode=Marketing,BadgeNumber=99999Response:
{
"Rsp": {
"Status": "Ok"
}
}Deletes a custom field definition. This removes the custom field from all entities of the specified type.
Example:
DELETE /customField/Cardholder/OldFieldNameResponse:
{
"Rsp": {
"Status": "Ok"
}
}Important
Deleting a custom field removes it from all entities. This operation cannot be undone.
Custom fields can be used as filters in EntityConfiguration reports.
GET /report/{EntityType}Configuration?q=CustomFields@CustomField(customFieldGuid,value)Parameters:
-
customFieldGuid- GUID of the custom field (not the field name) -
value- Value to filter by
Important
You must use the custom field's GUID, not its name. Custom field GUIDs can be obtained by querying an entity with the custom field set (see example below).
Filter cardholders by single custom field:
GET /report/CardholderConfiguration?q=CustomFields@CustomField(952ae0f6-dba6-401e-ae08-d152cf89ee1f,IT)Filter by multiple custom fields (logical AND):
GET /report/CardholderConfiguration?q=CustomFields@CustomField(952ae0f6-dba6-401e-ae08-d152cf89ee1f,IT)@CustomField(26f00b38-a5b5-4a5b-afc0-7379166b0099,true)Returns only entities where DepartmentCode = "IT" AND IsContractor = true.
Combine with entity type filter:
GET /report/EntityConfiguration?q=EntityTypes@Cardholder,CustomFields@CustomField(952ae0f6-dba6-401e-ae08-d152cf89ee1f,Sales)Response:
{
"Rsp": {
"Status": "Ok",
"Result": [
{"Guid": "984c7ac2-6c76-44c0-be2d-1de009b2a259"},
{"Guid": "631d3540-e293-469f-8a64-22b282cd7fd0"}
]
}
}To get a custom field's GUID, query any entity that has the custom field defined:
GET /entity/{entity-guid}
Accept: text/jsonIn the JSON response, look for the CustomFields array:
{
"CustomFields": [
{
"Guid": "952ae0f6dba6401eae08d152cf89ee1f",
"Name": "DepartmentCode",
"EntityType": "Cardholder",
"ValueType": "Text"
}
]
}When retrieving entity data, each custom field includes the following properties:
Core properties:
-
Name(string) - Custom field name -
Guid(GUID) - Unique identifier for the custom field -
EntityType(enum) - Entity type this field applies to -
ValueType(enum) - Data type (Text, Numeric, Boolean, etc.) -
Value(varies) - Current value for this entity -
DefaultValue(varies) - Default value when not set
Configuration properties:
-
Mandatory(boolean) - Whether field is required -
Unique(boolean) - Whether values must be unique -
IsEncrypted(boolean) - Whether values are encrypted -
ShowInReports(boolean) - Whether field appears in reports -
GroupName(string) - UI grouping name -
GroupPriority(int) - Display order in UI -
Owner(GUID) - Owner entity GUID -
CustomEntityTypeId(GUID) - For custom entity types
-
Image fields cannot be read via GET
- Attempting to read Image custom fields returns error:
"SdkErrorCode": "InvalidOperation", "Message": "Getting a value on an image custom fields is not supported." - Image fields must be accessed through other mechanisms
- Attempting to read Image custom fields returns error:
-
Field names with spaces or special characters have limitations
- Custom fields CAN be created with spaces in names via
/customFieldendpoints - However, they CANNOT be accessed using the
q=query syntax (e.g.,/entity?q=entity={guid},Field Namewill fail) - Recommendation: Use camelCase or underscore naming for maximum compatibility
- Examples:
DepartmentCode,Badge_Number,EmployeeID
- Custom fields CAN be created with spaces in names via
-
Custom field names are case-insensitive
-
DepartmentCodeanddepartmentcoderefer to the same field - However, it's recommended to use consistent casing for readability
-
-
Default values are applied at creation time
- When you create a custom field with a default value, existing entities receive that value
- New entities created after the custom field exists will also receive the default value
-
DateTime filtering not supported in Web SDK queries
- You cannot filter custom fields by DateTime values using the
/entityendpoint query syntax - DateTime filtering IS supported in EntityConfiguration reports
- You cannot filter custom fields by DateTime values using the
-
Custom field GUIDs required for filtering
- Report filters require the custom field GUID, not the name
- Custom field names cannot be used in CustomField() filter syntax
-
Value type enforcement
- Setting an invalid value for a data type returns an error
- Example: Setting "abc" for a Numeric field returns:
"Could not convert abc based on Numeric."
- Reading or writing a single custom field value
- Simple CRUD operations on custom field values
- Creating or deleting custom field definitions
- Direct access without querying other entity properties
- Reading multiple custom fields at once
- Combining custom fields with standard entity properties
- Batch operations across multiple entities
- When custom field access is part of larger entity query
- Finding entities by custom field values
- Complex queries with multiple conditions
- Generating entity lists based on custom criteria
- Reporting and analytics scenarios
- Entity Operations - General entity CRUD operations
- Referencing Entities - Entity queries and filtering
-
Security Center SDK Developer Guide Overview of the SDK framework and how to build integrations with Security Center.
-
Platform SDK
- Platform SDK Overview Introduction to the Platform SDK and core concepts.
- SDK Certificates Details certificates, licensing, and connection validation.
- Entity Guide Explains the core entity model, inheritance, and how to work with entities.
- Entity Cache Guide Describes the engine's local entity cache and synchronization.
- SDK Transactions Covers batching operations for performance and consistency.
- ReportManager Querying entities and activity data from Security Center.
- Events and Actions Subscribing to events and handling actions.
- Logging with the Genetec SDK How to configure logging, diagnostics, and debug methods.
- Referencing SDK Assemblies Best practices for referencing assemblies and resolving them at runtime.
- SDK Compatibility Guide Understanding backward compatibility and versioning in the SDK.
-
Plugin SDK
- Plugin SDK Overview Introduction to plugin architecture and capabilities.
- Plugin SDK Certificates SDK certificate requirements for plugin roles.
- Plugin SDK Lifecycle Initialization and disposal patterns.
- Plugin SDK Threading Threading model, QueueUpdate, and async patterns.
- Plugin SDK Configuration Configuration storage and monitoring.
- Plugin SDK Restricted Configuration Secure credential storage and admin-only configuration.
- Plugin SDK Database Database integration and schema management.
- Plugin SDK Events Event subscription and handling.
- Plugin SDK Queries Query processing and response handling.
- Plugin SDK Request Manager Request/response communication with clients.
- Plugin SDK Entity Ownership Understanding plugin-owned entities, running state management, and ownership release.
- Plugin SDK Entity Mappings Using EntityMappings for plugin-specific configuration and external system integration.
- Plugin SDK State Management Reporting plugin health and diagnostics.
- Plugin SDK Server Management High availability and server failover.
- Custom Privileges Defining and enforcing custom privileges.
- Resolving Non-SDK Assemblies Handling third-party dependencies in plugins and workspace modules.
- Deploying Plugins Registering and deploying plugins and workspace modules.
-
- Macro SDK Developer Guide Complete guide to creating server-side automation scripts in Security Center using C#.
- Getting Started Setup, authentication, and basic configuration for the Web SDK.
- Referencing Entities Entity discovery, search capabilities, and parameter formats.
- Entity Operations CRUD operations, multi-value fields, and method execution.
- Partitions Managing partitions, entity membership, and user access control.
- Custom Fields Creating, reading, writing, and filtering custom entity fields.
- Custom Card Formats Managing custom credential card format definitions.
- Actions Control operations for doors, cameras, macros, and notifications.
- Events and Alarms Real-time event monitoring, alarm monitoring, and custom events.
- Incidents Incident management, creation, and attachment handling.
- Reports Activity reports, entity queries, and historical data retrieval.
- Performance Guide Optimization tips and best practices for efficient API usage.
- Reference Entity GUIDs, EntityType enumeration, and EventType enumeration.
- Under the Hood Technical architecture, query reflection, and SDK internals.
- Troubleshooting Common error resolution and debugging techniques.
- Media Gateway Guide Setup and configuration of the Media Gateway role for video streaming.
- Web Player Guide Complete guide to integrating GWP for live and playback video streaming.
- Web Player API Reference Full API documentation with interfaces, methods, properties, and events.
- Web Player Sample Application Comprehensive demo showcasing all GWP features with timeline and PTZ controls.
- Genetec Web Player Multiplexing Sample Multi-camera grid demo using a shared WebSocket connection.