Create data route
POST/homes/{homeId}/dataRoutes
Base URL: https://api.tinkermode.com
Create a new data route in the project
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain the API key of a user or service account who has the permission to create all data routes of a project, or a Project API Key with admin permission.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
homeId | integer | Yes | The unique ID for a specified home. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dataType | string | Yes | read-only (server-generated) | Data type of the data route. It must be one of the supported data types: metrics and locations. | ||||||||||||||||||||
destination | object | Yes | Destination is the definition of the target entity of the data route. The entity must be predefined in the project or a wildcard entityId. | |||||||||||||||||||||
filterIds | array<string> | No | Filter IDs of the data route. Specify exact data filter IDs as values in the array. These filters are applied in the order specified. | |||||||||||||||||||||
filterTypes | array<string> | No | Filter types of the data route. The filter rules matched by the specified filter type are automatically applied to the data route. | |||||||||||||||||||||
homeId | integer | No | Home that this data route belongs to. | |||||||||||||||||||||
name | string | Yes | Display name of data route. | |||||||||||||||||||||
projectId | integer | Yes | read-only (server-generated) | Project that this data route belongs to. | ||||||||||||||||||||
routeId | string | Yes | read-only (server-generated) | Unique Data Route ID. | ||||||||||||||||||||
source | object | Yes | Source is the definition of the data source of the data route. The source must be referred to a Data Source or a wildcard data source. | |||||||||||||||||||||
| ||||||||||||||||||||||||
Request example
{
"dataType": "metrics",
"destination": {
"entityClass": "warehouse",
"entityId": "floor_1",
"metricsDefinitionId": "environment"
},
"filterIds": [
"lilz_gauge_conversion_filter_for_humidity"
],
"filterTypes": [
"conversion"
],
"homeId": 1234,
"name": "Data Route 1",
"projectId": 1234,
"routeId": "655346bb7e1e0d5217c55c92",
"source": {
"catalogId": "bu01",
"deviceId": 1234,
"sourceId": "a3b2ac399abc"
}
}Responses
201 Successful creation of data route.
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dataType | string | Yes | read-only (server-generated) | Data type of the data route. It must be one of the supported data types: metrics and locations. | ||||||||||||||||||||
destination | object | Yes | Destination is the definition of the target entity of the data route. The entity must be predefined in the project or a wildcard entityId. | |||||||||||||||||||||
filterIds | array<string> | No | Filter IDs of the data route. Specify exact data filter IDs as values in the array. These filters are applied in the order specified. | |||||||||||||||||||||
filterTypes | array<string> | No | Filter types of the data route. The filter rules matched by the specified filter type are automatically applied to the data route. | |||||||||||||||||||||
homeId | integer | No | Home that this data route belongs to. | |||||||||||||||||||||
name | string | Yes | Display name of data route. | |||||||||||||||||||||
projectId | integer | Yes | read-only (server-generated) | Project that this data route belongs to. | ||||||||||||||||||||
routeId | string | Yes | read-only (server-generated) | Unique Data Route ID. | ||||||||||||||||||||
source | object | Yes | Source is the definition of the data source of the data route. The source must be referred to a Data Source or a wildcard data source. | |||||||||||||||||||||
| ||||||||||||||||||||||||
Response example
{
"dataType": "metrics",
"destination": {
"entityClass": "warehouse",
"entityId": "floor_1",
"metricsDefinitionId": "environment"
},
"filterIds": [
"lilz_gauge_conversion_filter_for_humidity"
],
"filterTypes": [
"conversion"
],
"homeId": 1234,
"name": "Data Route 1",
"projectId": 1234,
"routeId": "655346bb7e1e0d5217c55c92",
"source": {
"catalogId": "bu01",
"deviceId": 1234,
"sourceId": "a3b2ac399abc"
}
}401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |