Response Content Types
The On Key API makes use of specific content types for returning success API responses for the GET
HTTP method. Any error, warning or information message response for a GET
, PATCH
, POST
or DELETE
HTTP method uses the notification content type.
Use the content types below to understand the different response formats returned as indicated by the documentation for the operation.
Notification
Content Type: application/vnd.onkey.notification+json
Used to return any error, warning or information message responses. The response body will contain a messages
collection. Each item in the messages
collection will contain the following elements.
Element | Required | Description |
---|---|---|
code |
Always | Unique code for the message. |
message |
Always | Message text. |
severity |
Always | Message severity using the following status classification:
|
objectId |
Optional | Unique On Key id for the record affected by the message. |
objectType |
Optional | Type of the existing record affected by the message. |
userObjectId |
Optional | User supplied unique id for the record affected by the message. Used in batch create requests. |
properties |
Optional | Properties for the record affected by the message. |
Sample Payload
{
"messages": [
{
"code": "Core_NotNullValidator",
"message": "{Asset->Code} must not be empty.",
"objectType": "Asset",
"objectId": "1540187821942001",
"properties": [
"Asset->Code"
],
"severity": "error"
}
]
}
Entity
Content Type: application/vnd.onkey.entity+json
Used to return a resource fetched using a GET
request. The properties
collection contains the individual resource property values. The links
collection contains hypermedia actions that can be executed for the resource.
Sample Payload
{
"class": "AlarmType",
"id": 5000010034,
"version": 2,
"properties": {
"code": "CSUP",
"createdByUserId": 2,
"createdByUserFullName": "OnKeyPlusConversion",
"createdOn": "2008-12-31T22:00:00.0000000Z",
"isActive": true,
"modifiedByUserId": 0,
"modifiedByUserFullName": "Admin Administrator",
"modifiedOn": "2008-12-31T22:00:00.0000000Z",
"permissionTreeId": 0,
"permissionTreeCode": "VIRTUAL - GLOBAL",
"permissionTreeDescription": "Configuration item shared by all Sites.",
"description": "Call Supervisor",
"notes": "Measurement of critical bearing and gearbox oil temperatures\n",
"sequenceNumber": 1
},
"links": [
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/GetAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/5000010034",
"method": "GET",
"module": "AHM",
"rel": "GetAlarmType",
"resource": "AlarmType",
"resourceAction": "GetAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/BatchGetAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/Batch/{ids:IdList}",
"method": "GET",
"module": "AHM",
"rel": "BatchGetAlarmType",
"resource": "AlarmType",
"resourceAction": "BatchGetAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/GetAlarmTypeCollection",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/",
"method": "GET",
"module": "AHM",
"rel": "GetAlarmTypeCollection",
"resource": "AlarmType",
"resourceAction": "GetAlarmTypeCollection",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/CreateAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/",
"method": "POST",
"module": "AHM",
"rel": "CreateAlarmType",
"resource": "AlarmType",
"resourceAction": "CreateAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/BatchCreateAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/Batch",
"method": "POST",
"module": "AHM",
"rel": "BatchCreateAlarmType",
"resource": "AlarmType",
"resourceAction": "BatchCreateAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/UpdateAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/5000010034",
"method": "PATCH",
"module": "AHM",
"rel": "UpdateAlarmType",
"resource": "AlarmType",
"resourceAction": "UpdateAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/BatchUpdateAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/Batch",
"method": "PATCH",
"module": "AHM",
"rel": "BatchUpdateAlarmType",
"resource": "AlarmType",
"resourceAction": "BatchUpdateAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/DeleteAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/5000010034",
"method": "DELETE",
"module": "AHM",
"rel": "DeleteAlarmType",
"resource": "AlarmType",
"resourceAction": "DeleteAlarmType",
"type": "primaryAction"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions/BatchDeleteAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/AlarmType/Batch",
"method": "DELETE",
"module": "AHM",
"rel": "BatchDeleteAlarmType",
"resource": "AlarmType",
"resourceAction": "BatchDeleteAlarmType",
"type": "primaryAction"
}
]
}
EntityCollection
Content Type: application/vnd.onkey.entitycollection+json
Used to return a batch of resources fetched using a GET
request. The items
collection contains the individual resource records returned.
Sample Payload
{
"count": 2,
"items": [
{
"class": "AlarmType",
"id": 5000010035,
"version": 3,
"properties": {
"code": "SMAC",
"createdByUserId": 2,
"createdByUserFullName": "OnKeyPlusConversion",
"createdOn": "2008-12-31T22:00:00.0000000Z",
"isActive": true,
"modifiedByUserId": 0,
"modifiedByUserFullName": "Admin Administrator",
"modifiedOn": "2008-12-31T22:00:00.0000000Z",
"permissionTreeId": 0,
"permissionTreeCode": "VIRTUAL - GLOBAL",
"permissionTreeDescription": "Configuration item shared by all Sites.",
"description": "Stop Machine",
"notes": "This is used to take oil samples of critical gearboxes and engines\n",
"sequenceNumber": 1
},
"links": []
},
{
"class": "AlarmType",
"id": 5000010034,
"version": 2,
"properties": {
"code": "CSUP",
"createdByUserId": 2,
"createdByUserFullName": "OnKeyPlusConversion",
"createdOn": "2008-12-31T22:00:00.0000000Z",
"isActive": true,
"modifiedByUserId": 0,
"modifiedByUserFullName": "Admin Administrator",
"modifiedOn": "2008-12-31T22:00:00.0000000Z",
"permissionTreeId": 0,
"permissionTreeCode": "VIRTUAL - GLOBAL",
"permissionTreeDescription": "Configuration item shared by all Sites.",
"description": "Call Supervisor",
"notes": "Measurement of critical bearing and gearbox oil temperatures\n",
"sequenceNumber": 1
},
"links": []
}
]
}
EntityCollectionPage
Content Type: application/vnd.onkey.entitycollectionpage+json
Used to return a pageable collection of resources fetched using a GET
request. Use the self
link to re-fetch the resource and the next
and prev
links to fetch the next or previous page of records. The items
collection contains the individual resource records returned.
Sample payload
{
"count": 2,
"self": {
"href": "api/tenants/{client}/{connectection}/modules/AHM/AlarmType/?$top=100&$skip=0",
"method": "GET",
"type": "navigation"
},
"next": {
"href": "api/tenants/{client}/{connection}/modules/AHM/AlarmType/?$top=100&$skip=100",
"method": "GET",
"type": "navigation"
},
"items": [
{
"class": "DomainDynamicRecord",
"id": 5000010034,
"version": 2,
"properties": {
"code": "CSUP",
"description": "Call Supervisor",
"notes": "Measurement of critical bearing and gearbox oil temperatures\n",
"sequenceNumber": 1,
"isActive": true,
"createdOn": "2008-12-31T22:00:00.0000000Z",
"modifiedOn": "2008-12-31T22:00:00.0000000Z"
},
"links": []
},
{
"class": "DomainDynamicRecord",
"id": 5000010035,
"version": 3,
"properties": {
"code": "SMAC",
"description": "Stop Machine",
"notes": "This is used to take oil samples of critical gearboxes and engines\n",
"sequenceNumber": 1,
"isActive": true,
"createdOn": "2008-12-31T22:00:00.0000000Z",
"modifiedOn": "2008-12-31T22:00:00.0000000Z"
},
"links": []
},
]
}
EntityMetadata
Content Type: application/vnd.onkey.entitymetadata+json
Used to return a definition for a resource fetched using a GET
request. The properties
collection contains the individual resource properties. For every property information like the data type, property path and validations are returned.
Sample Payload
{
"name": "Alarm",
"properties": [
{
"name": "description",
"path": "Alarm->Description",
"dataType": "string",
"validations": [
{
"Exclusive": null,
"Expression": null,
"Origin": "domain",
"Type": "null",
"Value": false
},
{
"Exclusive": null,
"Expression": null,
"Origin": "domain",
"Type": "minLength",
"Value": 1
},
{
"Exclusive": null,
"Expression": null,
"Origin": "domain",
"Type": "maxLength",
"Value": 500
},
{
"Exclusive": null,
"Expression": "(Alarm->MonitoringPointTriggerExpression_Id NE NULL) or (Alarm->Status EQ 'CancelledByUser' OR Alarm->Status EQ 'CancelledBySystem' OR Alarm->Status EQ 'Closed')",
"Origin": "domain",
"Type": "readonly",
"Value": true
}
]
},
{
"name": "createdByUserId",
"path": "Alarm->CreatedByUser_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "createdByUser",
"originalSourcePath": "User->Id"
},
{
"name": "createdByUserFullName",
"path": "Alarm->CreatedByUser_FullName",
"dataType": "string",
"referenceGroup": "createdByUser",
"originalSourcePath": "User->FullName"
},
{
"name": "createdOn",
"path": "Alarm->CreatedOn",
"dataType": "string",
"format": "date-time",
"validations": []
},
{
"name": "modifiedByUserId",
"path": "Alarm->ModifiedByUser_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "modifiedByUser",
"originalSourcePath": "User->Id"
},
{
"name": "modifiedByUserFullName",
"path": "Alarm->ModifiedByUser_FullName",
"dataType": "string",
"referenceGroup": "modifiedByUser",
"originalSourcePath": "User->FullName"
},
{
"name": "modifiedOn",
"path": "Alarm->ModifiedOn",
"dataType": "string",
"format": "date-time",
"validations": []
},
{
"name": "permissionTreeId",
"path": "Alarm->PermissionTree_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "permissionTree",
"originalSourcePath": "PermissionTree->Id",
"validations": [
{
"Exclusive": null,
"Expression": null,
"Origin": "domain",
"Type": "null",
"Value": false
}
]
},
{
"name": "permissionTreeCode",
"path": "Alarm->PermissionTree_Code",
"dataType": "string",
"referenceGroup": "permissionTree",
"originalSourcePath": "PermissionTree->Code"
},
{
"name": "permissionTreeDescription",
"path": "Alarm->PermissionTree_Description",
"dataType": "string",
"referenceGroup": "permissionTree",
"originalSourcePath": "PermissionTree->Description"
},
{
"name": "version",
"path": "Alarm->Version",
"dataType": "integer",
"format": "int32",
"validations": []
},
{
"name": "id",
"path": "Alarm->Id",
"dataType": "integer",
"format": "int64",
"validations": []
},
{
"name": "alarmTypeId",
"path": "Alarm->AlarmType_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "alarmType",
"originalSourcePath": "AlarmType->Id"
},
{
"name": "alarmTypeCode",
"path": "Alarm->AlarmType_Code",
"dataType": "string",
"referenceGroup": "alarmType",
"originalSourcePath": "AlarmType->Code"
},
{
"name": "alarmTypeDescription",
"path": "Alarm->AlarmType_Description",
"dataType": "string",
"referenceGroup": "alarmType",
"originalSourcePath": "AlarmType->Description"
},
{
"name": "monitoringPointTriggerExpressionId",
"path": "Alarm->MonitoringPointTriggerExpression_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "monitoringPointTriggerExpression",
"originalSourcePath": "MonitoringPointTriggerExpression->Id"
},
{
"name": "monitoringPointTriggerExpressionDescription",
"path": "Alarm->MonitoringPointTriggerExpression_Description",
"dataType": "string",
"referenceGroup": "monitoringPointTriggerExpression",
"originalSourcePath": "MonitoringPointTriggerExpression->Description"
},
{
"name": "notes",
"path": "Alarm->Notes",
"dataType": "string",
"validations": [
{
"Exclusive": null,
"Expression": "Alarm->Status EQ 'CancelledByUser' OR Alarm->Status EQ 'CancelledBySystem' OR Alarm->Status EQ 'Closed'",
"Origin": "domain",
"Type": "readonly",
"Value": true
}
]
},
{
"name": "status",
"path": "Alarm->Status",
"dataType": "object",
"validations": []
}
]
}
EntityEnumMetadata
Content Type: application/vnd.onkey.entityenummetadata+json
Used to return a collection of enumeration definitions for a resource using a GET
request. The properties
collection contains the individual properties for the resource that use the enumeration.
Sample Payload
{
"module": "AHM",
"entityType": "Alarm",
"properties": [
{
"name": "status",
"path": "Alarm->Status",
"dataType": "string",
"format": "enum",
"formatSpecifier": "AlarmStatus",
"values": [
"Active",
"Acknowledged",
"Closed",
"CancelledByUser",
"CancelledBySystem"
]
}
]
}
EntityDatabaseMetadata
Content Type: application/vnd.onkey.entitydatabasemetadata+json
Used to return the database definition for an entity using a GET
request. The properties
collection contains the database columns for the table. The queries
collection contains 4 sample queries that illustrate how to hydrate the entity with or without reference lookups and with or without permissions applied.
{
"module": "AOM",
"entityType": "Meter",
"hasDatabaseTable": true,
"sourceDatabase": "Transaction",
"primaryTableName": "aom.meter",
"primaryKeyColumnName": "meter_id",
"properties": [
{
"fullPropertyName": "Code",
"propertyPath": "Meter->Code",
"hasDbColumn": true,
"tableName": "aom.meter",
"columnName": "code",
"dbType": "Text",
"isEnum": false,
"isComposite": false
},
{
"fullPropertyName": "CreatedByUserId",
"propertyPath": "Meter->CreatedByUser_Id",
"hasDbColumn": true,
"tableName": "aom.meter",
"columnName": "created_by_user_id",
"dbType": "Bigint",
"isEnum": false,
"isComposite": false
},
{
"fullPropertyName": "CreatedByUserFullName",
"propertyPath": "Meter->CreatedByUser_FullName",
"hasDbColumn": true,
"tableName": "uam.user",
"columnName": "full_name",
"dbType": "Text",
"isEnum": false,
"isComposite": false,
"joins": [
"aom.meter.created_by_user_id = uam.user.user_id"
]
},
{
"fullPropertyName": "CreatedByUserCode",
"propertyPath": "Meter->CreatedByUser_Code",
"hasDbColumn": true,
"tableName": "uam.user",
"columnName": "code",
"dbType": "Text",
"isEnum": false,
"isComposite": false,
"joins": [
"aom.meter.created_by_user_id = uam.user.user_id"
]
},
...
{
"fullPropertyName": "Version",
"propertyPath": "Meter->Version",
"hasDbColumn": true,
"tableName": "aom.meter",
"columnName": "version",
"dbType": "Integer",
"isEnum": false,
"isComposite": false
},
{
"fullPropertyName": "Id",
"propertyPath": "Meter->Id",
"hasDbColumn": true,
"tableName": "aom.meter",
"columnName": "meter_id",
"dbType": "Bigint",
"isEnum": false,
"isComposite": false
},
{
"fullPropertyName": "AutomaticallyUpdateAverageDailyRate",
"propertyPath": "Meter->AutomaticallyUpdateAverageDailyRate",
"hasDbColumn": true,
"tableName": "aom.meter",
"columnName": "automatically_update_average_daily_rate",
"dbType": "Boolean",
"isEnum": false,
"isComposite": false
}
...
],
"queries": [
{
"primaryTableAlias": "_m",
"includePermissions": false,
"includeReferences": false,
"sql": "SELECT\n _m.code AS \"Code\",\n _m.created_by_user_id AS \"CreatedByUserId\",\n _m.created_on AS \"CreatedOn\",\n _m.is_active AS \"IsActive\",\n _m.modified_by_user_id AS \"ModifiedByUserId\",\n _m.modified_on AS \"ModifiedOn\",\n _m.permission_tree_id AS \"PermissionTreeId\",\n _m.site_id AS \"SiteId\",\n _m.version AS \"Version\",\n _m.meter_id AS \"Id\",\n _m.automatically_update_average_daily_rate AS \"AutomaticallyUpdateAverageDailyRate\",\n _m.auto_reset_value AS \"AutoResetValue\",\n _m.average_daily_rate AS \"AverageDailyRate\",\n _m.average_daily_rate_calculation_quantity AS \"AverageDailyRateCalculationQuantity\",\n _m.average_daily_rate_calculation_unit AS \"AverageDailyRateCalculationUnit\",\n _m.description AS \"Description\",\n _m.is_paused AS \"IsPaused\",\n _m.last_reading AS \"LastReading\",\n _m.last_read_on AS \"LastReadOn\",\n _m.notes AS \"Notes\",\n _m.unit_of_measurement_id AS \"UnitOfMeasurementId\"\nFROM\n aom.meter _m\n\n",
"parameters": null
},
...
]
}
EntityExistCheckResultCollection
Content Type: application/vnd.onkey.entityexistscheckresultcollection+json
Used to return a collection of entity exist results using a POST
request. The items
array contains a result entry for every record in the request. Use the UserObjectId
echoed in the response to link up the request items to the response data.
Sample payload
{
"items": [
{
"UserObjectId": "1",
"Exists": false
},
{
"UserObjectId": "3",
"Exists": false
},
{
"UserObjectId": "2",
"Exists": true,
"Id": 5000001033,
"Version": 12
},
{
"UserObjectId": "2",
"Exists": true,
"Id": 5000001025,
"Version": 13
},
{
"UserObjectId": "5",
"Exists": true,
"Id": 5000001002,
"Version": 9
},
{
"UserObjectId": "4",
"Exists": true,
"Id": 39,
"Version": 1
}
]
}
AssetRegisterTreeNode
Content Type: application/vnd.onkey.assetregistertreenode+json
Used to return an asset register tree node using a GET
request. The properties
collection contains the individual resource property values for the tree node. The childCounts
collection contains the number of different asset register nodes that are available as direct children for the specific tree node. The links
collection contains hypermedia actions that can be executed for the resource.
Sample Payload
{
"entityType": "AssetTypeFolder",
"id": 1,
"properties": {
"code": "ROOT",
"description": "ROOT"
},
"childCounts": {
"AssetTypeFolder": 11,
"RegularAssetType": 10
},
"links": [
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources/AssetTypeTree/Actions/GetTreeAssetTypeFolderCollectionForFolder",
"href": "api/tenants/{client}/{connection}/Modules/AMPC/AssetTypes/Tree/Folder/1/Folders",
"method": "GET",
"module": "AMPC",
"rel": "ChildFolders",
"resource": "AssetTypeTree",
"resourceAction": "GetTreeAssetTypeFolderCollectionForFolder",
"type": "detail"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources/AssetTypeTree/Actions/GetTreeRegularAssetTypeCollectionForFolder",
"href": "api/tenants/{client}/{connection}/Modules/AMPC/AssetTypes/Tree/Folder/1/RegularTypes",
"method": "GET",
"module": "AMPC",
"rel": "ChildAssetTypes",
"resource": "AssetTypeTree",
"resourceAction": "GetTreeRegularAssetTypeCollectionForFolder",
"type": "detail"
}
]
}
AssetRegisterTreeNodeCollectionPage
Content Type: application/vnd.onkey.assetregistertreenodecollectionpage+json
Used to return a collection of asset register tree nodes using a GET
request. Use the self
link to refetch the resource and the next
and prev
links to fetch the next or previous page of records. The items
collection contains the individual asset register tree node records returned.
Sample Payload
{
"count": 15,
"self": {
"href": "api/tenants/{client}/{connection}/Modules/AMPC/AssetTypes/Tree/Folder/1/Folders?$top=2000&$skip=0",
"method": "GET",
"type": "navigation"
},
"items": [
{
"entityType": "AssetTypeFolder",
"id": 5000001000,
"version": 20,
"properties": {
"code": "*1000",
"description": "1 Functional Units",
"alternativeDescription": "1 Functional Units",
"sequenceNumber": 1
},
"childCounts": {
"AssetTypeFolder": 0,
"RegularAssetType": 3
},
"links": []
},
{
"entityType": "AssetTypeFolder",
"id": 5000002009,
"version": 1,
"properties": {
"code": "XTESTOPTIONSFU",
"description": "Test Options Functional Units",
"alternativeDescription": "Test Options Functional Units",
"sequenceNumber": 1
},
"childCounts": {
"AssetTypeFolder": 0,
"RegularAssetType": 6
},
"links": []
}
],
"links": [
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources/AssetTypeTree/Actions/GetTreeAssetTypeFolderCollectionForFolder",
"href": "api/tenants/{client}/{connection}/Modules/AMPC/AssetTypes/Tree/Folder/{AssetTypeFolder->Id}/Folders",
"method": "GET",
"module": "AMPC",
"rel": "ChildFolders",
"resource": "AssetTypeTree",
"resourceAction": "GetTreeAssetTypeFolderCollectionForFolder",
"type": "detail"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources/AssetTypeTree/Actions/GetTreeRegularAssetTypeCollectionForFolder",
"href": "api/tenants/{client}/{connection}/Modules/AMPC/AssetTypes/Tree/Folder/{AssetTypeFolder->Id}/RegularTypes",
"method": "GET",
"module": "AMPC",
"rel": "ChildAssetTypes",
"resource": "AssetTypeTree",
"resourceAction": "GetTreeRegularAssetTypeCollectionForFolder",
"type": "detail"
}
]
}
AssetRegisterTreeNode
Content Type: application/vnd.onkey.assetregistertreenode+json
Used to return a Asset Register tree node using a GET
request.
Sample payload
{
"entityType": "AssetTypeFolder",
"id": 1,
"properties": {
"code": "ROOT",
"description": "ROOT"
},
"childCounts": {
"AssetTypeFolder": 11,
"RegularAssetType": 10
},
"links": []
}
AssetRegisterTreeNodeCollectionPage
Content Type: application/vnd.onkey.assetregistertreenodecollectionpage+json
Used to return a pageable collection of Asset Register tree nodes fetched using a GET
request. Use the self
link to re-fetch the resource and the next
and prev
links to fetch the next or previous page of records. The items
collection contains the individual tree node records returned.
Sample payload
{
"count": 19,
"self": {
"href": "api/tenants/contoso/test/Modules/AMPC/AssetTypes/Tree/AssetTypeFolders/1/AssetTypeFolders?$top=2000&$skip=0",
"method": "GET",
"type": "navigation"
},
"items": [
{
"entityType": "AssetTypeFolder",
"id": 5000001000,
"version": 20,
"properties": {
"code": "*1000",
"description": "1 Functional Units",
"alternativeDescription": "1 Functional Units",
"sequenceNumber": 1
},
"childCounts": {
"AssetTypeFolder": 0,
"RegularAssetType": 3
},
"links": []
},
{
"entityType": "AssetTypeFolder",
"id": 5000001002,
"version": 31,
"properties": {
"code": "*1002",
"description": "3 Machines",
"alternativeDescription": "3 Machines",
"sequenceNumber": 1
},
"childCounts": {
"AssetTypeFolder": 4,
"RegularAssetType": 0
},
"links": []
},
{
"entityType": "AssetTypeFolder",
"id": 5000001003,
"version": 20,
"properties": {
"code": "*1003",
"description": "2 Sub-Assemblies",
"alternativeDescription": "2 Sub-Assemblies",
"sequenceNumber": 1
},
"childCounts": {
"AssetTypeFolder": 0,
"RegularAssetType": 1
},
"links": []
}
],
"links": [
{
"doc": "api/tenants/contoso/test/Docs/Modules/AMPC/Resources/AssetTypeTree/Actions/GetTreeAssetTypeFolderCollection",
"href": "api/tenants/contoso/test/Modules/AMPC/AssetTypes/Tree/{parentNodeType:TreeNodeType}/{parentId:long}/AssetTypeFolders",
"method": "GET",
"module": "AMPC",
"rel": "ChildFolders",
"resource": "AssetTypeTree",
"resourceAction": "GetTreeAssetTypeFolderCollection",
"type": "detail"
}
]
}
ResourceSchema
Content Type: application/vnd.onkey.resourceschema+json
Used to return a json schema definition for a specific schema using a GET
request.
Sample Payload
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "EntityDeleteSchema",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": [
"integer",
"null"
],
"description": "Id of Resource",
"format": "int64"
},
"version": {
"type": [
"integer",
"null"
],
"description": "Version of Resource",
"format": "int32"
}
}
}
ResourceSchemaCollection
Content Type: application/vnd.onkey.resourceschemacollection+json
Used to return a collection of available schema definitions for the system using a GET
request. The items
collection contains the individual schema names. For every item a links
collection with a Metaschema
link is provided to get the actual schema definition.
Sample Payload
{
"items": [
{
"schemaName": "EntityCollectionPageSchema",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Metaschemas/EntityCollectionPageSchema",
"method": "GET",
"rel": "Metaschema"
}
]
},
{
"schemaName": "EntityCollectionSchema",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Metaschemas/EntityCollectionSchema",
"method": "GET",
"rel": "Metaschema"
}
]
},
]
}
ModuleCollection
Content Type: application/vnd.onkey.modulecollection+json
Used to return a collection of modules within the system using a GET
request.
The items
collection contains the individual modules. For every module a links
collection is provided:
ModuleResources
- link to get the resources available within the moduleModuleResourcesActions
- link to get the resource actions available within the moduleModuleResourceSpecification
- link to get an OpenAPI specification for the module
Sample Payload
{
"items": [
{
"name": "AHM",
"description": "Asset Health Management",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources",
"method": "GET",
"rel": "ModuleResources"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Actions",
"method": "GET",
"rel": "ModuleResourceActions"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Spec",
"method": "GET",
"rel": "ModuleResourceSpecification",
"type": "specification"
}
]
},
{
"name": "AMPC",
"description": "Asset and Maintenance Plan Configuration",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources",
"method": "GET",
"rel": "ModuleResources"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources/Actions",
"method": "GET",
"rel": "ModuleResourceActions"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AMPC/Resources/Spec",
"method": "GET",
"rel": "ModuleResourceSpecification",
"type": "specification"
}
]
},
]
}
Resource
Content Type: application/vnd.onkey.resource+json
Used to return a resource definition using a GET
request.
The primaryActions
collection can contain the following hypermedia links:
fetch
- link to get the resourcebatchFetch
- link to get a resource batchquery
- link to query the resourcecreate
- link to create the resourcebatchCreate
- link to create a resource batchupdate
- link to update the resourcebatchUpdate
- link to update a resource batch
The links
collection can contain the following hypermedia links:
detail
- link to get the resource actions availablelookup
- links to get the different lookups for the resource
Sample Payload
{
"name": "Alarm",
"self": {
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm",
"method": "GET",
"module": "AHM",
"resource": "Alarm"
},
"primaryActions": {
"fetch": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/GetAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/{Alarm->Id}",
"method": "GET",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "GetAlarm"
},
"batchFetch": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/BatchGetAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/Batch/{ids:IdList}",
"method": "GET",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "BatchGetAlarm"
},
"query": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/GetAlarmCollection",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/",
"method": "GET",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "GetAlarmCollection"
},
"create": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/",
"method": "POST",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "CreateAlarm"
},
"batchCreate": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/BatchCreateAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/Batch",
"method": "POST",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "BatchCreateAlarm"
},
"update": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/UpdateAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/{Alarm->Id}",
"method": "PATCH",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "UpdateAlarm"
},
"batchUpdate": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/BatchUpdateAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/Batch",
"method": "PATCH",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "BatchUpdateAlarm"
}
},
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions",
"method": "GET",
"module": "AHM",
"rel": "AlarmActions",
"resource": "Alarm",
"type": "detail"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/LookupAlarmAlarmType",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/Lookups/LookupAlarmAlarmType",
"mapping": [
{
"source": "AlarmType->Id",
"target": "Alarm->AlarmType_Id"
},
{
"source": "AlarmType->Code",
"target": "Alarm->AlarmType_Code"
},
{
"source": "AlarmType->Description",
"target": "Alarm->AlarmType_Description"
}
],
"method": "GET",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "LookupAlarmAlarmType",
"type": "lookup"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/LookupAlarmChangePermissionTree",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/Lookups/LookupAlarmChangePermissionTree",
"mapping": [
{
"source": "PermissionTree->Id",
"target": "Alarm->PermissionTree_Id"
},
{
"source": "PermissionTree->Code",
"target": "Alarm->PermissionTree_Code"
},
{
"source": "PermissionTree->Description",
"target": "Alarm->PermissionTree_Description"
}
],
"method": "GET",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "LookupAlarmChangePermissionTree",
"type": "lookup"
},
{
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/LookupAlarmInsertPermissionTree",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/Lookups/LookupAlarmInsertPermissionTree",
"mapping": [
{
"source": "PermissionTree->Id",
"target": "Alarm->PermissionTree_Id"
},
{
"source": "PermissionTree->Code",
"target": "Alarm->PermissionTree_Code"
},
{
"source": "PermissionTree->Description",
"target": "Alarm->PermissionTree_Description"
}
],
"method": "GET",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "LookupAlarmInsertPermissionTree",
"type": "lookup"
}
]
}
ResourceCollection
Content Type: application/vnd.onkey.resourcecollection+json
Used to return a collection of resource definition summaries scoped per module using a GET
request. The items
collection contains the individual resources grouped into the different modules. For every item the links
collection contains Resource
and ResourceActions
hypermedia links to get the fully expanded resource definitions for the resource.
Sample Payload
{
"items": [
{
"moduleName": "AHM",
"resourceName": "Alarm",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm",
"method": "GET",
"rel": "Resource"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions",
"method": "GET",
"rel": "ResourceActions",
"type": "documentation"
}
]
},
{
"moduleName": "AHM",
"resourceName": "AlarmType",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType",
"method": "GET",
"rel": "Resource"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/AlarmType/Actions",
"method": "GET",
"rel": "ResourceActions",
"type": "documentation"
}
]
},
]
}
ResourceAction
Content Type: application/vnd.onkey.resourceaction+json
Used to return a fully expanded resource action definition using a GET
request. The endpoint
property contains the url path, HTTP method and other information for the resource action. The resource
property links the resource action to its resource. The uriFeatures
property indicates what kind of actions can be done with the resource action (i.e. filter, sub-select, order etc.).
The request
property contains the request body definition for a request that sends data via the API. The response
property contains the response body definition for a request that returns data via the API.
For the request
or response
properties, the contentType
, features
and entity
properties indicate what format and features are supported. The properties
collection contains the definition of the resource properties send/returned via the request
or response
bodies respectively.
Sample Payload
{
"type": "Create",
"name": "CreateAlarm",
"endpoint": {
"doc": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm",
"href": "api/tenants/{client}/{connection}/Modules/AHM/Alarms/",
"method": "POST",
"module": "AHM",
"resource": "Alarm",
"resourceAction": "CreateAlarm",
"type": "primaryAction"
},
"resource": {
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm",
"method": "GET",
"module": "AHM",
"resource": "Alarm"
},
"self": {
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm",
"method": "GET",
"type": "documentation"
},
"uriFeatures": {
"canSubSelect": false,
"canFilter": false,
"canOrder": false,
"canPage": false
},
"request": {
"contentType": "application/application/vnd.onkey.entity+json",
"features": {
"canSaveCustomInstance": false,
"canExpand": false,
"canOrder": false
},
"entity": {
"name": "Alarm",
"metadataTree": {
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree",
"method": "GET",
"rel": "Expand",
"type": "navigation"
}
},
"properties": [
{
"name": "alarmTypeId",
"path": "Alarm->AlarmType_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "alarmType",
"originalSourcePath": "AlarmType->Id",
"validations": [
{
"type": "required",
"origin": "api",
"value": true
},
{
"type": "null",
"origin": "api",
"value": false
}
],
"lookups": [
"LookupAlarmAlarmType"
]
},
{
"name": "description",
"path": "Alarm->Description",
"dataType": "string",
"validations": [
{
"type": "null",
"origin": "domain",
"value": false
},
{
"type": "minLength",
"origin": "domain",
"value": 1
},
{
"type": "maxLength",
"origin": "domain",
"value": 500
},
{
"type": "readonly",
"expression": "(Alarm->MonitoringPointTriggerExpression_Id NE NULL) or (Alarm->Status EQ 'CancelledByUser' OR Alarm->Status EQ 'CancelledBySystem' OR Alarm->Status EQ 'Closed')",
"origin": "domain",
"value": true
},
{
"type": "required",
"origin": "api",
"value": true
},
{
"type": "null",
"origin": "api",
"value": false
}
]
},
{
"name": "permissionTreeId",
"path": "Alarm->PermissionTree_Id",
"dataType": "integer",
"format": "int64",
"referenceGroup": "permissionTree",
"originalSourcePath": "PermissionTree->Id",
"validations": [
{
"type": "null",
"origin": "domain",
"value": false
},
{
"type": "required",
"origin": "api",
"value": true
},
{
"type": "null",
"origin": "api",
"value": false
}
],
"lookups": [
"LookupAlarmChangePermissionTree",
"LookupAlarmInsertPermissionTree"
]
},
{
"name": "notes",
"path": "Alarm->Notes",
"dataType": "string",
"validations": [
{
"type": "readonly",
"expression": "Alarm->Status EQ 'CancelledByUser' OR Alarm->Status EQ 'CancelledBySystem' OR Alarm->Status EQ 'Closed'",
"origin": "domain",
"value": true
}
]
}
]
},
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm/Customisations/",
"method": "POST",
"rel": "CreateResourceActionCustomisation",
"type": "documentation"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm/Customisations/{customisationId:long}",
"method": "PUT",
"rel": "UpdateResourceActionCustomisation",
"type": "documentation"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm/Customisations/{customisationId:long}",
"method": "DELETE",
"rel": "DeleteResourceActionCustomisation",
"type": "documentation"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm/Customisations/",
"method": "GET",
"rel": "GetResourceActionCustomisationCollection",
"type": "documentation"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/CreateAlarm/Customisations/{customisationId:long}",
"method": "GET",
"rel": "GetResourceActionCustomisation",
"type": "documentation"
}
]
}
ResourceActionCollection
Content Type: application/vnd.onkey.resourceactioncollection+json
Used to return a resource action summary scoped per module using a GET
request. The items
collection contains the resource action summaries grouped per module. For every resource action summary the links
collection contains a documentation
hypermedia link to get the fully expanded resource action definition for the resource.
Sample Payload
{
"items": [
{
"moduleName": "AHM",
"resourceName": "Alarm",
"resourceActionName": "BatchCreateAlarm",
"type": "BatchCreate",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/BatchCreateAlarm",
"method": "GET",
"module": "Alarm",
"rel": "ResourceAction",
"resource": "BatchCreateAlarm",
"type": "documentation"
}
],
"httpMethod": "POST"
},
{
"moduleName": "AHM",
"resourceName": "Alarm",
"resourceActionName": "BatchGetAlarm",
"type": "BatchFetch",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Resources/Alarm/Actions/BatchGetAlarm",
"method": "GET",
"module": "Alarm",
"rel": "ResourceAction",
"resource": "BatchGetAlarm",
"type": "documentation"
}
],
"httpMethod": "GET"
},
]
}
CustomResourceAction
Content Type: application/vnd.onkey.customresourceaction+json
Used to return an existing resource action customisation using a GET
request. For a request customisation the request
property contains the customised request body content. For a response customisation the response
property contains the customised response body content.
Sample Payload
{
"id": 1551837894801001,
"version": 1,
"resource": "Alarm",
"resourceAction": "GetAlarmCollection",
"name": "MyAlarmList-1551837895",
"description": "This is my alarm list",
"isTemp": false,
"response": {
"properties": [
{
"path": "Alarm->Id"
},
{
"path": "Alarm->Description"
}
],
"orderBy": "Alarm->Id"
}
}
Template
Content Type: application/vnd.onkey.template+json
Used to return a template definition using a GET
request. The content
property contains the structure of the template body.
Sample Payload
{
"module": "AHM",
"name": "AlarmDashboard",
"type": "Dashboard",
"content": {
"type": "Query",
"variables": {
"translations": {
"titles": {
"labelAlarmTypeCode": "Alarm Type Code",
"labelAlarmTypeDescription": "Alarm Type Description",
"labelDescription": "Description",
"labelSequenceNumber": "Sequence Number",
"labelStatus": "Status",
"labelPanelBarTitle": "Alarms",
"labelButtonView": "View",
"labelButtonDetails": "Details"
}
}
},
"perspectives": [
{
"id": 0,
"name": "details",
"id-field": "id",
"data": {
"cache": "GetAlarmCollectionDashboardCache",
"aggregate": "count",
"sorting": {
"sequenceNumber": "ascending"
}
}
}
],
"datasets": [
{
"id": 0,
"name": "model",
"fields": [
{
"name": "selectedId"
},
{
"name": "alarm",
"listen-for": "selectedId",
"dataset": 1
},
{
"name": "details",
"collection": true,
"datasource": 0
}
]
},
{
"id": 1,
"name": "alarm",
"fields": [
{
"name": "createdByUserId"
},
{
"name": "createdByUserFullName"
},
{
"name": "createdOn"
},
{
"name": "modifiedByUserId"
},
{
"name": "modifiedByUserFullName"
},
{
"name": "modifiedOn"
},
{
"name": "permissionTreeId"
},
{
"name": "permissionTreeCode"
},
{
"name": "permissionTreeDescription"
},
{
"name": "version"
},
{
"name": "id"
},
{
"name": "alarmTypeId"
},
{
"name": "alarmTypeCode"
},
{
"name": "alarmTypeDescription"
},
{
"name": "description"
},
{
"name": "notes"
},
{
"name": "sequenceNumber"
},
{
"name": "status"
},
{
"name": "monitoringPointTriggerExpressionDescription"
}
],
"primaryActions": {
"load": {
"action": "GetAlarm",
"parameters": {
"Alarm->Id": "viewModel.model.selectedId[0]"
}
}
}
}
],
"datasources": [
{
"id": 0,
"remote": "Alarm",
"action": "GetAlarmCollection",
"primaryActions": {
"delete": {
"action": "DeleteAlarm",
"parameters": {
"Alarm->Id": "viewModel.model.selectedId[0]"
}
},
"batch-delete": {
"action": "BatchDeleteAlarm"
}
},
"perspective": {
"cache": "AlarmCache",
"perspectives": [
0
]
}
}
],
"actions": [
{
"id": 0,
"action": "postMessage",
"parameters": {
"query": "pragma-split-view",
"message": "toggle"
}
},
{
"id": 1,
"action": "context.navigateToDetails"
},
{
"id": 100,
"action": "context.performGlobalUpdate",
"parameters": {
"remote": "Alarm",
"resourceId": "model.selectedId[0]"
}
}
],
"templates": [
{
"id": 0,
"elements": [
{
"element": "pragma-grid",
"elements": [
{
"element": "pragma-grid-column",
"attributes": {
"field": "description",
"title": "@translations.titles.labelDescription"
}
},
{
"element": "pragma-grid-column",
"attributes": {
"field": "sequenceNumber",
"title": "@translations.titles.labelSequenceNumber"
}
},
{
"element": "pragma-grid-column",
"attributes": {
"field": "status",
"title": "@translations.titles.labelStatus"
}
},
{
"element": "pragma-grid-column",
"attributes": {
"field": "alarmTypeCode",
"title": "@translations.titles.labelAlarmTypeCode"
}
},
{
"element": "pragma-grid-column",
"attributes": {
"field": "alarmTypeDescription",
"title": "@translations.titles.labelAlarmTypeDescription"
}
}
],
"attributes": {
"id": "dashboard-grid",
"selection": "multiple",
"selected-id.bind": "model.selectedId",
"id-field": "id",
"datasource.bind": "model.details",
"perspective": 0,
"doubleclick.delegate": "performAction(100)"
}
}
]
},
{
"id": 1,
"elements": [
{
"element": "pragma-form",
"attributes": {
"remote": "Alarm",
"type": "view",
"model.bind": "model.alarm"
}
}
]
}
],
"body": {
"elements": [
{
"element": "panel-bar",
"title": "@translations.titles.labelPanelBarTitle",
"styles": "fullheight",
"actions": [
{
"element": "dynamic-crud-toolbar",
"attributes": {
"actions": [
"refresh",
"delete",
"batch-delete"
],
"for": "dashboard-grid"
}
},
{
"element": "button",
"title": "@translations.titles.labelButtonView",
"action": 0,
"styles": "aux"
},
{
"element": "button",
"title": "@translations.titles.labelButtonDetails",
"action": 1,
"styles": "aux"
}
],
"elements": [
{
"element": "split-view",
"attributes": {
"split-percentage": 50
},
"left": [
{
"element": "template",
"template": 0,
"styles": "fullheight"
}
],
"right": [
{
"element": "template",
"template": 1,
"styles": "fullheight"
}
]
}
]
}
]
},
"resource": "Alarm"
}
}
TemplateCollection
Content Type: application/vnd.onkey.templatecollection+json
Used to return a collection of template definitions scoped per module using a GET
request. For every template the links
collection contains a Template
hypermedia link to get the fully expanded template definition for the resource.
Sample Payload
{
"items": [
{
"moduleName": "AHM",
"templateName": "AlarmCreate",
"templateType": "Create",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Templates/AHM",
"method": "GET",
"rel": "Template"
}
]
},
{
"moduleName": "AHM",
"templateName": "AlarmDashboard",
"templateType": "Dashboard",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Templates/AHM",
"method": "GET",
"rel": "Template"
}
]
},
]
}
CustomTemplate
Content Type: application/vnd.onkey.customtemplate+json
Used to return a template customisation using a GET
request. The content
property contains the structure of the template body.
Sample Payload
{
"id": 1551832393159002,
"version": 1,
"module": "AHM",
"template": "AlarmDashboard",
"name": "MyAlarmDashboard",
"description": "This is my alarm dashboard",
"isTemp": false,
"content": {
same as application/vnd.onkey.template+json content type
}
}
Menu
Content Type: application/vnd.onkey.menu+json
Used to return a system menu using a GET
request.
Sample Payload
{
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Metaschemas/",
"method": "GET",
"rel": "MetaschemaCollection"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Metaschemas/{schemaName}",
"method": "GET",
"rel": "Metaschema"
},
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/Metadata/Entities",
"method": "GET",
"rel": "EntityMetadataCollection",
"type": "navigation"
}
]
}
Spec
Content Type: application/vnd.onkey.spec+json
Used to return an OpenAPI specification for a single module or for the whole system using a GET
request.
MetadataCollection
Content Type: application/vnd.onkey.metadatacollection+json
Used to return a collection of resource definition summaries scoped per module using a GET
request. The items
collection contains the individual resources grouped into the different modules. For every item the links
collection contains a navigation
link to get the fully expanded resource definition for the resource.
Sample Payload
{
"items": [
{
"moduleName": "AHM",
"entityName": "Alarm",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm",
"method": "GET",
"rel": "EntityMetadata",
"type": "navigation"
}
]
},
{
"moduleName": "AHM",
"entityName": "AlarmType",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/AlarmType",
"method": "GET",
"rel": "EntityMetadata",
"type": "navigation"
}
]
}
]
}
EnumMetadata
Content Type: application/vnd.onkey.enummetadata+json
Used to return a enumeration definition using a GET
request. The values
collection contains the individual enumeration values. The usedBy
collection contains an entry for every entity that uses the enumeration. For every item the entityName
refers to the entity and the propertyName
refers to the property on the entity that uses the enumeration. The propertyPath
contains the property path for the property.
Sample Payload
{
"name": "LocalisationSetType",
"values": [
"Phrases",
"UI",
"ValueLists",
"Messages"
],
"usedBy": [
{
"entityName": "LocalisationKey",
"propertyName": "localisationSetType",
"propertyPath": "LocalisationKey->LocalisationSet_Type"
},
{
"entityName": "LocalisationTranslation",
"propertyName": "localisationKeyLocalisationSetType",
"propertyPath": "LocalisationTranslation->LocalisationKey_LocalisationSet_Type"
},
{
"entityName": "LocalisationSet",
"propertyName": "type",
"propertyPath": "LocalisationSet->Type"
}
]
}
EnumMetadataCollection
Content Type: application/vnd.onkey.enummetadatacollection+json
Used to return a collection of all enumeration definitions within the system using a GET
request. The items
collection contains the individual enumerations. For every item the values
collection contains the individual enumeration values and the usedBy
collection contains an entry for the different entities that use the enumeration.
Sample Payload
{
"count": 68,
"items": [
{
...
{
"name": "LocalisationSetType",
"values": [
"Phrases",
"UI",
"ValueLists",
"Messages"
],
"usedBy": [
{
"entityName": "LocalisationKey",
"propertyName": "localisationSetType",
"propertyPath": "LocalisationKey->LocalisationSet_Type"
},
{
"entityName": "LocalisationTranslation",
"propertyName": "localisationKeyLocalisationSetType",
"propertyPath": "LocalisationTranslation->LocalisationKey_LocalisationSet_Type"
},
{
"entityName": "LocalisationSet",
"propertyName": "type",
"propertyPath": "LocalisationSet->Type"
}
]
},
...
}
]
}
MetadataTree
Content Type: application/vnd.onkey.metadatatree+json
Used to return a tree node collection for a resource using a GET
request. The nodes
collection contains the individual resource property nodes. Nodes that can be further expanded contain a links
collection with a detail
link to get the expanded resource definition for the sub-node.
Sample Payload
{
"entityName": "Alarm",
"nodes": [
{
"name": "Description",
"generatedName": "Description",
"path": "Alarm->Description",
"dataType": "string",
"selectable": true,
"links": []
},
{
"name": "CreatedByUser",
"generatedName": "CreatedByUser",
"path": "Alarm->CreatedByUser",
"expandable": true,
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree/Alarm->CreatedByUser",
"method": "GET",
"rel": "Expand",
"type": "detail"
}
]
},
{
"name": "CreatedOn",
"generatedName": "CreatedOn",
"path": "Alarm->CreatedOn",
"dataType": "string",
"format": "date-time",
"selectable": true,
"links": []
},
{
"name": "ModifiedByUser",
"generatedName": "ModifiedByUser",
"path": "Alarm->ModifiedByUser",
"expandable": true,
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree/Alarm->ModifiedByUser",
"method": "GET",
"rel": "Expand",
"type": "detail"
}
]
},
{
"name": "ModifiedOn",
"generatedName": "ModifiedOn",
"path": "Alarm->ModifiedOn",
"dataType": "string",
"format": "date-time",
"selectable": true,
"links": []
},
{
"name": "PermissionTree",
"generatedName": "PermissionTree",
"path": "Alarm->PermissionTree",
"expandable": true,
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree/Alarm->PermissionTree",
"method": "GET",
"rel": "Expand",
"type": "detail"
}
]
},
{
"name": "Version",
"generatedName": "Version",
"path": "Alarm->Version",
"dataType": "integer",
"format": "int32",
"selectable": true,
"links": []
},
{
"name": "Id",
"generatedName": "Id",
"path": "Alarm->Id",
"dataType": "integer",
"format": "int64",
"selectable": true,
"links": []
},
{
"name": "AlarmType",
"generatedName": "AlarmType",
"path": "Alarm->AlarmType",
"expandable": true,
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree/Alarm->AlarmType",
"method": "GET",
"rel": "Expand",
"type": "detail"
}
]
},
{
"name": "MonitoringPointTriggerExpression",
"generatedName": "MonitoringPointTriggerExpression",
"path": "Alarm->MonitoringPointTriggerExpression",
"expandable": true,
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree/Alarm->MonitoringPointTriggerExpression",
"method": "GET",
"rel": "Expand",
"type": "detail"
}
]
},
{
"name": "Notes",
"generatedName": "Notes",
"path": "Alarm->Notes",
"dataType": "string",
"selectable": true,
"links": []
},
{
"name": "Status",
"generatedName": "Status",
"path": "Alarm->Status",
"dataType": "object",
"selectable": true,
"links": []
}
]
}
MetadataTreePathMapCollection
Content Type: application/vnd.onkey.metadatatreepathmapcollection+json
Used to return a tree node path map collection for a resource property path using a GET
request. The items
collection contains the individual resource property nodes with the root node as the first item in the collection. Subsequent items in the collection represents the next level within the tree path. For every item a links
collection with a navigation
link to expand the resource definition for the sub-node is provided.
Sample Payload
{
"count": 2,
"items": [
{
"expandPath": "",
"targetName": "CreatedByUser",
"targetPath": "Alarm->CreatedByUser",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree",
"method": "GET",
"rel": "Expand",
"type": "navigation"
}
]
},
{
"expandPath": "Alarm->CreatedByUser",
"targetName": "Id",
"targetPath": "Alarm->CreatedByUser_Id",
"links": [
{
"href": "api/tenants/{client}/{connection}/Docs/Modules/AHM/Metadata/Entities/Alarm/Tree/Alarm->CreatedByUser",
"method": "GET",
"rel": "Expand",
"type": "navigation"
}
]
}
]
}
UserDefinedQueryPage
Content Type: application/vnd.onkey.userdefinedquerypage+json
Used to return a user defined query using a GET
request. The query
property contains the SQL query, columns and parameters.
Sample payload
{
"class": "UserDefinedQuery",
"id": 1600689488869002,
"version": 1,
"properties": {
"code": "AverageDailyRate",
"createdByUserId": 500000000000,
"createdByUserFullName": "Administrator",
"createdByUserCode": "DefaultNonAuthUser",
"createdOn": "2020-09-21T11:58:08.8697930Z",
"modifiedByUserId": 500000000000,
"modifiedByUserFullName": "Administrator",
"modifiedByUserCode": "DefaultNonAuthUser",
"modifiedOn": "2020-09-21T11:58:08.8698900Z",
"permissionTreeId": 5000001004,
"permissionTreeCode": "A11",
"permissionTreeDescription": "ABC Facility Denver",
"addPermissionFilter": false,
"description": "Query Description",
"entity": null,
"notes": "notes",
"query": {
"sql": "SELECT average_daily_rate, last_reading, last_read_on FROM aom.meter where meter_id = @meterId",
"columns": [
{
"propertyName": "AverageDailyRate",
"columnName": "average_daily_rate",
"propertyPath": "Meter->AverageDailyRate",
"output": true
},
{
"propertyName": "LastReading",
"columnName": "last_reading",
"propertyPath": "Meter->LastReading",
"output": true
},
{
"propertyName": "LastReadOn",
"columnName": "last_read_on",
"propertyPath": "Meter->LastReadOn",
"output": true
}
],
"parameters": [
{
"parameterName": "@meterId"
}
]
},
"sequenceNumber": null
},
"links": []
}
TranslationSet
Content Type: application/vnd.onkey.translationset+json
Used to return a translation set using a GET
request. The items
property contains a list of the localisation keys for the translation set.
Sample payload
{
"id": 7,
"name": "AOM",
"langId": null,
"lang": "en",
"items": [
{
"name": "labelCode",
"value": "Code",
"source": "System"
},
{
"name": "labelDescription",
"value": "Description",
"source": "System"
}
]
}