The Things Network Connector REST version v1
https://cloud.kaaiot.com/ttnc/api/v1
Integrations
Creates new application integration and returns it.
Application integration links a TTN application with a corresponding application in the KaaIoT platform.
Returns application integrations. If 'status' parameter not used, then returns only ACTIVE application integrations.
post /integrations
Creates new application integration and returns it.
Application integration links a TTN application with a corresponding application in the KaaIoT platform.
- application:ttn-app-integration:create
TTNC supports OAuth 2.0 for authenticating all API requests.
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- appName: required(string)
The KaaIoT platform application name.
- ttnUsername: required(string)
The Things Network username (https://www.thethingsindustries.com/docs/integrations/mqtt/#note-on-using-the-tenant-id).
- ttnApiKeyId: required(string)
The Things Network application API key.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
The Identity Server manages user accounts, applications, devices, and gateways in TTN, and handles authentication (login, API keys, OAuth) and access control (permissions and rights). - ttnNetworkServerHost: (string)
The Things Network (TTN) Network Server host address.
If not configured that ttnIdentityServerHost will be used instead. - ttnJoinServerHost: (string)
The Things Network Join Server host address.
If not configured that ttnIdentityServerHost will be used instead. - ttnApplicationServerHost: (string)
The Things Network Application Server host address.
If not configured that ttnIdentityServerHost will be used instead. - ttnPlainMqttServerUrl: (string)
The Things Network MQTT Server URL address.
Should be configured if MQTT integration is enabled. - ttnMqttIntegrationEnabled: (boolean - default: true)
Enable TTN MQTT integration MQTT.
Sometimes it needs the data from TTN to come not via TTNC service, but for example via Node-red. In such a case, the device integration should not subscribe to MQTT messages from the TTN and we set this parameter tofalse
.
The ttnPlainMqttServerUrl is not used when ttnMqttIntegrationEnabled isfalse
. - name: required(string)
Application integration name.
- description: (string)
Application integration description.
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the application integrations will be attached.
Example:
{
"appName": "q4hhh0cckgmc6ivflvag",
"ttnUsername": "lorawan-smart-farm@ttn",
"ttnApiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
"ttnIdentityServerHost":"eu1.cloud.thethings.network",
"ttnJoinServerHost":"eu1.cloud.thethings.network",
"ttnNetworkServerHost":"eu1.cloud.thethings.network",
"ttnApplicationServerHost":"eu1.cloud.thethings.network",
"ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
"ttnMqttIntegrationEnabled": true,
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration",
"poolIds": [
"aXJuOnJjNzNkYmg3cTA6aWFtY29yZTo0YXRjaWNuaXNnOjpwb29sL2Rldg=="
]
}
HTTP status code 201
Application integration was successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}:{port}/api/v1/integrations/{id}
Example:
http://example.com/api/v1/integrations/267
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Application integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUsername: required(string)
The Things Network username.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- ttnNetworkServerHost: (string)
The Things Network (TTN) Network Server host address.
- ttnJoinServerHost: (string)
The Things Network Join Server host address.
- ttnApplicationServerHost: (string)
The Things Network Application Server host address.
- ttnPlainMqttServerUrl: (string)
The Things Network MQTT Server URL address.
- ttnMqttIntegrationEnabled: required(boolean)
Enable TTN MQTT integration MQTT. false when, for example, used Node-red for message parsing. In such a case ttnPlainMqttServerUrl not used.
- name: required(string)
Application integration name.
- description: (string)
Application integration description.
- status: required(one of ACTIVE, SUSPENDED)
Application integration status.
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the application integration will be attached.
Example:
{
"id": 267,
"appName": "q4hhh0cckgmc6ivflvag",
"ttnUsername": "lorawan-farm-app@ttn",
"ttnIdentityServerHost":"eu1.cloud.thethings.network",
"ttnJoinServerHost":"eu1.cloud.thethings.network",
"ttnNetworkServerHost":"eu1.cloud.thethings.network",
"ttnApplicationServerHost":"eu1.cloud.thethings.network",
"ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
"ttnMqttIntegrationEnabled": true,
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration",
"status": "ACTIVE"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 409
TtnUsername or appName already used by some application integration.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Example:
{
"message": "Application name [c7r38d3a8vkfafj9jipg] already used in other application integration."
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /integrations
Returns application integrations. If 'status' parameter not used, then returns only ACTIVE application integrations.
- ttn-app-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Query Parameters
- appName: (string)
Filters application integrations by application name.
Example:
my-application
HTTP status code 200
Application integrations are successfully retrieved.
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of app-dev-integration-types.AppIntegrationDetailedResponse)
Items: AppIntegrationDetailedResponse
- id: required(integer)
Application integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUsername: required(string)
The Things Network username.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- ttnNetworkServerHost: (string)
The Things Network (TTN) Network Server host address.
- ttnJoinServerHost: (string)
The Things Network Join Server host address.
- ttnApplicationServerHost: (string)
The Things Network Application Server host address.
- ttnPlainMqttServerUrl: (string)
The Things Network MQTT Server URL address.
- ttnMqttIntegrationEnabled: required(boolean)
Enable TTN MQTT integration MQTT. false when, for example, used Node-red for message parsing. In such a case ttnPlainMqttServerUrl not used.
- name: required(string)
Application integration name.
- description: (string)
Application integration description.
- status: required(one of ACTIVE, SUSPENDED)
Application integration status.
- ttnConnectionState: required(one of CONNECTED, DISCONNECTED)
Application integration TTN MQTT connection state.
- `CONNECTED` - connection successful
- `DISCONNECTED` - There is some problem with the connection
- ttnConnectionError: (string)
Error description (if there is any problem with the TTN MQTT connection).
- kpcConnectionState: required(one of CONNECTED, DISCONNECTED)
Tenant application integrations KPC MQTT connection state.
- `CONNECTED` - connection successful
- `DISCONNECTED` - There is some problem with the connection
- kpcConnectionError: (string)
Error description (if there is any problem with the KPC MQTT connection for the tenant).
- id: required(integer)
Example:
{
"totalElements": 2,
"content": [
{
"id": 267,
"appName": "q4hhh0cckgmc6ivflvag",
"ttnUsername": "lorawan-smart-farm@ttn",
"ttnIdentityServerHost":"eu1.cloud.thethings.network",
"ttnJoinServerHost":"eu1.cloud.thethings.network",
"ttnNetworkServerHost":"eu1.cloud.thethings.network",
"ttnApplicationServerHost":"eu1.cloud.thethings.network",
"ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
"ttnMqttIntegrationEnabled": true,
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration",
"status": "ACTIVE",
"ttnConnectionState": "CONNECTED",
"kpcConnectionState": "CONNECTED"
},
{
"id": 351,
"appName": "0cckq4hhhgmc6ivflasd",
"ttnUsername": "lorawan-smart-farm2@ttn",
"ttnIdentityServerHost":"eu1.cloud.thethings.network",
"ttnJoinServerHost":"eu1.cloud.thethings.network",
"ttnNetworkServerHost":"eu1.cloud.thethings.network",
"ttnApplicationServerHost":"eu1.cloud.thethings.network",
"ttnMqttIntegrationEnabled": false,
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration",
"status": "SUSPENDED",
"ttnConnectionState": "DISCONNECTED",
"ttnConnectionError": "Not authorized to connect",
"kpcConnectionState": "CONNECTED"
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns application integration.
Updates application integration.
Deletes application integration if there is no one device integration connected with this application integration.
get /integrations/{appIntegrationId}
Returns application integration.
- ttn-app-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 200
Application integration is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Application integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUsername: required(string)
The Things Network username.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- ttnNetworkServerHost: (string)
The Things Network (TTN) Network Server host address.
- ttnJoinServerHost: (string)
The Things Network Join Server host address.
- ttnApplicationServerHost: (string)
The Things Network Application Server host address.
- ttnPlainMqttServerUrl: (string)
The Things Network MQTT Server URL address.
- ttnMqttIntegrationEnabled: required(boolean)
Enable TTN MQTT integration MQTT. false when, for example, used Node-red for message parsing. In such a case ttnPlainMqttServerUrl not used.
- name: required(string)
Application integration name.
- description: (string)
Application integration description.
- status: required(one of ACTIVE, SUSPENDED)
Application integration status.
- ttnConnectionState: required(one of CONNECTED, DISCONNECTED)
Application integration TTN MQTT connection state.
- `CONNECTED` - connection successful
- `DISCONNECTED` - There is some problem with the connection
- ttnConnectionError: (string)
Error description (if there is any problem with the TTN MQTT connection).
- kpcConnectionState: required(one of CONNECTED, DISCONNECTED)
Tenant application integrations KPC MQTT connection state.
- `CONNECTED` - connection successful
- `DISCONNECTED` - There is some problem with the connection
- kpcConnectionError: (string)
Error description (if there is any problem with the KPC MQTT connection for the tenant).
Example:
{
"id": 351,
"appName": "0cckq4hhhgmc6ivflvag",
"ttnUsername": "lorawan-smart-farm2@ttn",
"ttnIdentityServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnNetworkServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnJoinServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnApplicationServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnPlainMqttServerUrl": "eu2.cloud.thethings.industries:1883",
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration",
"status": "ACTIVE",
"ttnMqttIntegrationEnabled": true,
"ttnConnectionState": "DISCONNECTED",
"ttnConnectionError": "Unable to connect to server",
"kpcConnectionState": "CONNECTED"
}
HTTP status code 404
Application integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
patch /integrations/{appIntegrationId}
Updates application integration.
- ttn-app-integration:update
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- ttnNetworkServerHost: (string)
The Things Network (TTN) Network Server host address.
- ttnJoinServerHost: (string)
The Things Network Join Server host address.
- ttnApplicationServerHost: (string)
The Things Network Application Server host address.
- ttnApiKeyId: (string)
The Things Network application API key.
- name: (string)
Application integration name.
- description: (string)
Application integration description.
Example:
{
"ttnNetworkServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnJoinServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnApplicationServerHost": "farmtenant.eu1.cloud.thethings.industries",
"ttnApiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration"
}
HTTP status code 200
Application integration is successfully updated.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Application integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUsername: required(string)
The Things Network username.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- ttnNetworkServerHost: (string)
The Things Network (TTN) Network Server host address.
- ttnJoinServerHost: (string)
The Things Network Join Server host address.
- ttnApplicationServerHost: (string)
The Things Network Application Server host address.
- ttnPlainMqttServerUrl: (string)
The Things Network MQTT Server URL address.
- ttnMqttIntegrationEnabled: required(boolean)
Enable TTN MQTT integration MQTT. false when, for example, used Node-red for message parsing. In such a case ttnPlainMqttServerUrl not used.
- name: required(string)
Application integration name.
- description: (string)
Application integration description.
- status: required(one of ACTIVE, SUSPENDED)
Application integration status.
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the application integration will be attached.
Example:
{
"id": 267,
"appName": "q4hhh0cckgmc6ivflvag",
"ttnUsername": "lorawan-farm-app@ttn",
"ttnIdentityServerHost":"eu1.cloud.thethings.network",
"ttnJoinServerHost":"eu1.cloud.thethings.network",
"ttnNetworkServerHost":"eu1.cloud.thethings.network",
"ttnApplicationServerHost":"eu1.cloud.thethings.network",
"ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
"ttnMqttIntegrationEnabled": true,
"name": "Smart Farm",
"description": "Smart farm LoRaWAN devices integration",
"status": "ACTIVE"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Application integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /integrations/{appIntegrationId}
Deletes application integration if there is no one device integration connected with this application integration.
- ttn-app-integration:delete
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 204
Application integration successfully deleted.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Application integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Creates new device integrations. (Max - 5 device integrations per request).
Device integration connects an individual TTN LoRaWAN device to an endpoint (digital twin) in the KaaIoT platform.
Returns all device integrations inside application integration. If 'status' parameter not used, then returns only ACTIVE device integrations.
post /integrations/{appIntegrationId}/devices
Creates new device integrations. (Max - 5 device integrations per request).
Device integration connects an individual TTN LoRaWAN device to an endpoint (digital twin) in the KaaIoT platform.
- ttn-app-integration:ttn-device-integration:create
- application:endpoint:create
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- appVersionName: required(string)
The KaaIoT platform application version name that integrated devices should work in.
- devices: required(array of app-dev-integration-types.DevIntegrationItemCreate)
List of devices to create integration for.
Items: DevIntegrationItemCreate
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- endpointMetadata: (object)
Allows the configuration of the metadata of endpoint that will be created during integration creation.
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type. - endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- ttnDeviceId: required(string)
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the device integrations will be attached.
Example:
{
"appVersionName": "q4hhh0cckgmc6ivflvag-v2",
"devices": [
{
"ttnDeviceId": "eui-1b789bc1325f8",
"name": "Moisture monitor integration 25",
"description": "Greenhouse 1",
"endpointMetadata": {
"name": "LoRa moisture sensor 25",
"serial": "AC53743462-34"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
]
}
],
"poolIds": [
"aXJuOnJjNzNkYmg3cTA6aWFtY29yZTo0YXRjaWNuaXNnOjpwb29sL2Rldg=="
]
}
HTTP status code 201
Device integrations are created.
Body
Media type: application/json
Type: object
Properties- createdCount: required(integer)
Count of device integrations with successful creation.
- failedCount: required(integer)
Count of device integrations with failed creation.
- created: required(array of app-dev-integration-types.DevIntegrationResponse)
Array of device integrations with successful creation.
Items: DevIntegrationResponse
- id: required(integer)
Device integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- endpointId: required(string)
Kaa endpoint unique identifier.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- status: required(one of ACTIVE, SUSPENDED)
Device integration status.
- id: required(integer)
- failed: required(array of app-dev-integration-types.DevIntegrationFailedResponse)
Array of device integrations with failed creation.
Items: DevIntegrationFailedResponse
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- reason: (string)
Cause of failing device integration creation.
- ttnDeviceId: required(string)
Example:
{
"createdCount": 2,
"failedCount": 1,
"created": [
{
"id": 10,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnDeviceId": "eui-1b789bc1325a5",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Moisture monitor 25",
"description": "Greenhouse 1",
"status": "ACTIVE"
},
{
"id": 25,
"appVersionName": "0cckq4hhhgmc6ivflvag-v2",
"ttnDeviceId": "eui-1b789bc1325a6",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7445",
"name": "Moisture monitor 27",
"description": "Greenhouse 1",
"status": "ACTIVE"
}
],
"failed": [
{
"ttnDeviceId": "eui-1b789bc1325b8",
"reason": "Can't create endpoint for appIntegrationId [303], appVersionName [0cckq4hhhgmc6ivflvag-v1]"
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /integrations/{appIntegrationId}/devices
Returns all device integrations inside application integration. If 'status' parameter not used, then returns only ACTIVE device integrations.
- ttn-device-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Query Parameters
- page: (number - default: 0)
Page number.
Example:
0
- size: (number - default: 100)
Page size.
Example:
10
HTTP status code 200
Device integrations are successfully retrieved.
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of app-dev-integration-types.DevIntegrationResponse)
Items: DevIntegrationResponse
- id: required(integer)
Device integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- endpointId: required(string)
Kaa endpoint unique identifier.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- status: required(one of ACTIVE, SUSPENDED)
Device integration status.
- id: required(integer)
Example:
{
"totalElements": 2,
"content": [
{
"id": 10,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnDeviceId": "eui-1b789bc1325a5",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Moisture monitor integration 25",
"description": "Greenhouse 1",
"status": "ACTIVE"
},
{
"id": 25,
"appVersionName": "0cckq4hhhgmc6ivflvag-v2",
"ttnDeviceId": "eui-1b789bc1325a6",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7445",
"name": "Moisture monitor integration 28",
"description": "Greenhouse 1",
"status": "ACTIVE"
}
]
}
HTTP status code 404
Application integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Create a task to register a batch of device integrations within a specified application integration.
post /integrations/{appIntegrationId}/devices/batch
Create a task to register a batch of device integrations within a specified application integration.
- ttn-app-integration:ttn-device-integration:create
- application:endpoint:create
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Body
Media type: application/json
Type: object
Properties- appVersionName: required(string)
The KaaIoT platform application version name that integrated devices should work in.
- devices: required(array of app-dev-integration-types.BatchDevIntegrationItemCreate)
Items: BatchDevIntegrationItemCreate
- ttnDeviceId: (string)
The Things Network device unique identifier. Generated automatically if not specified.
- joinEui: required(string)
64-bit unique identifier (JoinEUI/AppEUI) in EUI-64 assigned to the LoRaWAN network’s Join Server by either its owner or operator.
- devEui: required(string)
64-bit unique device identifier (DevEUI) in EUI-64 that uniquely identifies the end-device.
- appKey: required(string)
128-bit Application Root Key (AppKey).
- frequencyPlanId: required(string)
The Things Network ID of the frequency plan used by this device. https://www.thethingsindustries.com/docs/reference/frequency-plans/
- lorawanVersion: (string - default: MAC_V1_0_3)
The Things Network LoRaWAN MAC version. Stored in Network Server. https://www.thethingsindustries.com/docs/api/reference/grpc/end_device/#enum:MACVersion
- lorawanPhyVersion: (string - default: PHY_V1_0_3_REV_A)
The Things Network LoRaWAN PHY version. Stored in Network Server. https://www.thethingsindustries.com/docs/api/reference/grpc/end_device/#enum:PHYVersion
- supportsJoin: (boolean - default: true)
The device supports join (OTAA).
- multicast: (boolean - default: false)
Indicates whether this device represents a multicast group.
- supportsClassB: (boolean - default: false)
Whether the device supports class B.
- supportsClassC: (boolean - default: false)
Whether the device supports class C.
- macSettings: required(object)
Settings for how the Network Server handles MAC layer for this device. Stored in Network Server.
- rx2DataRateIndex: required(number)
Data rate index for Rx2. If unset, the default value from Network Server configuration or regional parameters specification will be used.
- rx2Frequency: required(string)
Frequency for Rx2 (Hz). If unset, the default value from Network Server configuration or regional parameters specification will be used.
- rx2DataRateIndex: required(number)
- ttnDeviceName: (string)
TTN Device name.
- ttnDeviceDescription: (string)
TTN Device description.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- ttnDeviceId: (string)
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the device integrations will be attached.
Example:
{
"appVersionName": "example_app_v1",
"devices": [
{
"ttnDeviceId": "eui-1b789bc1325a5",
"joinEui": "800000000000000C",
"devEui": "1B789BC1325A5",
"appKey": "C8F86AFE569D72157616CCAB05E15D88",
"frequencyPlanId": "EU_863_870_TTN",
"lorawanVersion": "MAC_V1_0_3",
"lorawanPhyVersion": "PHY_V1_0_3_REV_A",
"supportsJoin": true,
"multicast": false,
"supportsClassB": false,
"supportsClassC": false,
"macSettings": {
"rx2DataRateIndex": 0,
"rx2Frequency": "869525000"
},
"ttnDeviceName": "Moisture monitor 25",
"ttnDeviceDescription": "Greenhouse 1",
"name": "Moisture monitor integration 25",
"description": "Greenhouse 1",
"endpointMetadata": {
"name": "LoRa moisture sensor 25",
"serial": "AC53743462-34"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
]
}
],
"poolIds": [
"aXJuOnJjNzNkYmg3cTA6aWFtY29yZTo0YXRjaWNuaXNnOjpwb29sL2Rldg=="
]
}
HTTP status code 202
Batch device integration registration task is accepted.
Body
Media type: application/json
Type: object
Properties- taskId: required(string)
Batch device integrations registration task ID.
Example:
{
"taskId":"79c717d9-eedd-4f71-b9f8-86caf69809e4"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns batch device integration registration task status.
get /integrations/{appIntegrationId}/devices/batch/status
Returns batch device integration registration task status.
- ttn-app-integration:read
- ttn-device-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
Query Parameters
- taskId: required(string)
Batch device integration registration task ID.
Example:
79c717d9-eedd-4f71-b9f8-86caf69809e4
HTTP status code 200
Batch device integration registration task's status is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- createdCount: required(integer)
Count of device integrations with successful registration.
- failedCount: required(integer)
Count of device integrations with failed registration.
- created: required(array of app-dev-integration-types.BatchDevIntegrationItemCreated)
Array of device integrations with successful registration.
Items: BatchDevIntegrationItemCreated
- id: required(integer)
Device integration unique identifier.
- devEui: required(string)
64-bit unique device identifier in (EUI-64) that uniquely identifies the end-device (DevEUI).
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- endpointId: required(string)
Endpoint ID.
- ttnDeviceName: (string)
TTN Device name.
- ttnDeviceDescription: (string)
TTN Device description.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- id: required(integer)
- failed: required(array of app-dev-integration-types.BatchDevIntegrationItemFailed)
Array of device integrations with failed registration.
Items: BatchDevIntegrationItemFailed
- devEui: required(string)
64-bit unique device identifier in (EUI-64) that uniquely identifies the end-device (DevEUI).
- reason: (string)
Cause of failing device integration creation.
- devEui: required(string)
Example:
{
"createdCount": 2,
"failedCount": 1,
"created": [
{
"id": 124,
"devEui": "1B789BC1325A5",
"ttnDeviceId": "eui-1b789bc1325a5",
"appVersionName": "example_app_v1",
"endpointId": "56726466-e454-23ac-340c-f34fefda7de4",
"ttnDeviceName": "Moisture sensor 25",
"ttnDeviceDescription": "Greenhouse 1",
"name": "device-25",
"endpointMetadata": {
"name": "LoRa moisture sensor 25",
"serial": "AC53743462-34"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
]
},
{
"id": 125,
"devEui": "1B789BC1325A8",
"ttnDeviceId": "eui-1b789bc1325a8",
"appVersionName": "example_app_v1",
"endpointId": "56726466-e454-23ac-340c-f34fefda7df2",
"ttnDeviceName": "Moisture sensor 28",
"ttnDeviceDescription": "Greenhouse 1",
"name": "device-28",
"endpointMetadata": {
"name": "LoRa moisture sensor 28",
"serial": "AC53743462-37"
}
}
],
"failed": [
{
"devEui": "1B789BC1325A2",
"reason": "Device integration for the specified device EUI already exists."
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns device integration.
Updates device integration.
get /integrations/{appIntegrationId}/devices/{devIntegrationId}
Returns device integration.
- ttn-device-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
- devIntegrationId: required(integer)
Device integration ID
Example:
568
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 200
Device integration is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Device integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- endpointId: required(string)
Kaa endpoint unique identifier.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- status: required(one of ACTIVE, SUSPENDED)
Device integration status.
Example:
{
"id": 10,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnDeviceId": "eui-1b789bc1325a5",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Moisture monitor integration 25",
"description": "Greenhouse 1",
"endpointMetadata": {
"name": "LoRa moisture sensor 25",
"serial": "AC53743462-34"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
],
"status": "ACTIVE"
}
HTTP status code 404
Device integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
patch /integrations/{appIntegrationId}/devices/{devIntegrationId}
Updates device integration.
- ttn-device-integration:update
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
- devIntegrationId: required(integer)
Device integration ID
Example:
568
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- name: (string)
Device integration name.
- description: (string)
Device integration description.
Example:
{
"name": "Moisture monitor integration 25",
"description": "Greenhouse 1"
}
HTTP status code 200
Device integration is successfully updated.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Device integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnDeviceId: required(string)
The Things Network device unique identifier.
- endpointId: required(string)
Kaa endpoint unique identifier.
- name: required(string)
Device integration name.
- description: (string)
Device integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- status: required(one of ACTIVE, SUSPENDED)
Device integration status.
Example:
{
"id": 10,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnDeviceId": "eui-1b789bc1325a5",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Moisture monitor integration 25",
"description": "Greenhouse 1",
"endpointMetadata": {
"name": "LoRa moisture sensor 25",
"serial": "AC53743462-34"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
],
"status": "ACTIVE"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Device integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Sets the current device integration status. For now, allowed status transitions are:
- Active → Suspended
put /integrations/{appIntegrationId}/devices/{devIntegrationId}/status
Sets the current device integration status. For now, allowed status transitions are:
- Active → Suspended
- ttn-device-integration:update
- endpoint:update
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- appIntegrationId: required(integer)
Application integration ID
Example:
351
- devIntegrationId: required(integer)
Device integration ID
Example:
568
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- status: required(SUSPENDED)
The status of the device integration.
- SUSPENDED - device integration is suspended
Example:
{
"status": "SUSPENDED"
}
HTTP status code 204
Device integration status is successfully updated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Account integrations
Creates new account integration and returns it.
Account integration provides access to TTN gateways metadata and statistics (TTN account-level information).
Returns account integrations. If 'status' parameter not used, then returns only ACTIVE account integrations.
post /account-integrations
Creates new account integration and returns it.
Account integration provides access to TTN gateways metadata and statistics (TTN account-level information).
- application:ttn-account-integration:create
TTNC supports OAuth 2.0 for authenticating all API requests.
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- appName: required(string)
The KaaIoT platform application name.
- ttnUserId: required(string)
The Things Network user ID.
It is the unique identifier (username) associated with your account. - ttnApiKeyId: required(string)
The Things Network user level API key.
API key should be configured at least with such rights (minimum rights):
- view gateway information,
- view gateway status,
- create a gateway under user account,
- list the gateways the user is a collaborator of. - ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
The Identity Server manages user accounts, applications, devices, and gateways in TTN, and handles authentication (login, API keys, OAuth) and access control (permissions and rights). - name: required(string)
The KaaIoT platform account integration name.
The human readable name to help identify the account integration. - description: (string)
The KaaIoT platform account integration description.
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the account integration will be attached.
Example:
{
"appName": "q4hhh0cckgmvagc6ivfl",
"ttnUserId": "farm-industry",
"ttnApiKeyId": "EJXRNLCPHQEI6HINNSXSUTZLUSVLCAK2.AP4GRTOXHBAZ33HFDS67BVEXNNY4D5LVW.5CHH7KAABI57RJPLR5WYDIGPEXAMPLE",
"ttnIdentityServerHost": "farmtenant.eu1.cloud.thethings.industries",
"name": "Smart Farm gateways",
"description": "Smart farm LoRaWAN gateways integration",
"poolIds": [
"aXJuOnJjNzNkYmg3cTA6aWFtY29yZTo0YXRjaWNuaXNnOjpwb29sL2Rldg=="
]
}
HTTP status code 201
Account integration was successfully created.
Headers
- Location: required(string)
URI in format
{schema}://{host}:{port}/api/v1/gateway-integrations/{id}
Example:
http://example.com/api/v1/account-integrations/25
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Account integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUserId: required(string)
The Things Network user ID.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- name: required(string)
Account integration name.
- description: (string)
Account integration description.
- status: required(one of ACTIVE, SUSPENDED)
Account integration status.
- error: (string)
Error description (if there is any problem with the TTN or KPC connection).
Example:
{
"id": 25,
"appName": "q4hhh0cckgmvagc6ivfl",
"ttnUserId": "farm-industry",
"ttnIdentityServerHost": "eu1.cloud.thethings.network",
"name": "Smart Farm gateways",
"description": "Smart farm LoRaWAN gateways integration",
"status": "ACTIVE"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /account-integrations
Returns account integrations. If 'status' parameter not used, then returns only ACTIVE account integrations.
- ttn-account-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Query Parameters
- appName: (string)
Filters account integrations by KaaIoT application name.
Example:
my-application
HTTP status code 200
Account integrations are successfully retrieved.
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of account-gateway-integration-types.AccountIntegrationResponse)
Items: AccountIntegrationResponse
- id: required(integer)
Account integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUserId: required(string)
The Things Network user ID.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- name: required(string)
Account integration name.
- description: (string)
Account integration description.
- status: required(one of ACTIVE, SUSPENDED)
Account integration status.
- error: (string)
Error description (if there is any problem with the TTN or KPC connection).
- id: required(integer)
Example:
{
"totalElements": 1,
"content": [
{
"id": 25,
"appName": "q4hhh0cckgmvagc6ivfl",
"ttnUserId": "farm-industry",
"ttnIdentityServerHost": "eu1.cloud.thethings.network",
"name": "Smart Farm gateways",
"description": "Smart farm LoRaWAN gateways integration",
"status": "ACTIVE"
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns account integration.
Updates account integration.
Deletes account integration if there is no one gateway integration connected with this account integration.
get /account-integrations/{accountIntegrationId}
Returns account integration.
- ttn-account-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 200
Account integration is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Account integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUserId: required(string)
The Things Network user ID.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- name: required(string)
Account integration name.
- description: (string)
Account integration description.
- status: required(one of ACTIVE, SUSPENDED)
Account integration status.
- error: (string)
Error description (if there is any problem with the TTN or KPC connection).
Example:
{
"id": 25,
"appName": "q4hhh0cckgmvagc6ivfl",
"ttnUserId": "farm-industry",
"ttnIdentityServerHost": "eu1.cloud.thethings.network",
"name": "Smart Farm gateways",
"description": "Smart farm LoRaWAN gateways integration",
"status": "ACTIVE"
}
HTTP status code 404
Account integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
patch /account-integrations/{accountIntegrationId}
Updates account integration.
- ttn-account-integration:update
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- ttnApiKeyId: (string)
The Things Network user level API key.
API key should be configured at least with such rights (minimum rights):
- view gateway information,
- view gateway status,
- create a gateway under user account,
- list the gateways the user is a collaborator of. - name: (string)
The KaaIoT platform account integration name.
- description: (string)
The KaaIoT platform account integration description.
Example:
{
"ttnApiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
"name": "Smart Farm",
"description": "Smart farm LoRaWAN gateways integration"
}
HTTP status code 200
Account integration is successfully updated.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
Account integration unique identifier.
- appName: required(string)
The KaaIoT platform application name.
- ttnUserId: required(string)
The Things Network user ID.
- ttnIdentityServerHost: required(string)
The Things Network Identity Server host address.
- name: required(string)
Account integration name.
- description: (string)
Account integration description.
- status: required(one of ACTIVE, SUSPENDED)
Account integration status.
- error: (string)
Error description (if there is any problem with the TTN or KPC connection).
Example:
{
"id": 25,
"appName": "q4hhh0cckgmvagc6ivfl",
"ttnUserId": "farm-industry",
"ttnIdentityServerHost": "eu1.cloud.thethings.network",
"name": "Smart Farm gateways",
"description": "Smart farm LoRaWAN gateways integration",
"status": "ACTIVE"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Account integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /account-integrations/{accountIntegrationId}
Deletes account integration if there is no one gateway integration connected with this account integration.
- ttn-account-integration:delete
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 204
Account integration successfully deleted.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Account integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Creates new gateway integrations. (Max - 5 gateway integrations per request).
Gateway integration maps a TTN LoRaWAN gateway to an endpoint on the KaaIoT platform.
Returns all gateway integrations inside account integration. If 'status' parameter not used, then returns only ACTIVE gateway integrations.
post /account-integrations/{accountIntegrationId}/gateways
Creates new gateway integrations. (Max - 5 gateway integrations per request).
Gateway integration maps a TTN LoRaWAN gateway to an endpoint on the KaaIoT platform.
- ttn-account-integration:ttn-gateway-integration:create
- application:endpoint:create
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- appVersionName: required(string)
The KaaIoT platform application version name with gateways' endpoints.
- registerGatewaysOnTtn: (boolean - default: false)
Used in case when we want to create not only gateway integration on KaaIoT platform but the gateway on the TTN.
Iftrue
then ttnGatewayInfo should be configured for the gateways. - gateways: required(array of account-gateway-integration-types.GatewayIntegrationItemCreate)
List of TTN gateways to create integration for.
Items: GatewayIntegrationItemCreate
- ttnGatewayId: required(string)
The Things Network gateway unique identifier.
A mandatory identifier for you gateway that must be unique per network and cannot be changed after creation. Enter a value using lowercase letters, numbers and dashes. You can choose this freely. - name: required(string)
The KaaIoT platform gateway integration name.
The human readable name to help identify your gateway integration. - description: (string)
The KaaIoT platform gateway integration description.
- endpointMetadata: (object)
Allows the configuration of the metadata of endpoint that will be created during integration creation. The metadata of LoRaWAN device' "digital twin". Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints.
Only one of the directions - eitherto
orfrom
, must be specified in each relation entry.
For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- ttnGatewayInfo: (object)
Gateway information to register on The Things Network. Required if registerGatewaysOnTtn is true
- ttnGatewayEui: required(string)
The Things Network gateway EUI. A 64 bit extended unique identifier for your gateway. It should be provided to you by the manufacturer, or printed on the gateway package.
- ttnGatewayName: (string)
The Things Network gateway name. An optional human readable name to help identify your gateway.
- frequencyPlanId: required(string)
The Things Network ID of the frequency plan used by this device. https://www.thethingsindustries.com/docs/reference/frequency-plans/
- statusPublic: (boolean - default: false)
The status of this gateway may be publicly displayed.
- locationPublic: (boolean - default: false)
The location of this gateway may be publicly displayed.
- gatewayServerAddress: required(string)
The address of the Gateway Server to connect to.
- enforceDutyCycle: (boolean - default: true)
Enforcing gateway duty cycle is recommended for all gateways to respect spectrum regulations. Disable enforcing the duty cycle only in controlled research and development environments.
- scheduleAnytimeDelay: (number - default: 0.53)
Adjust the time that GS schedules class C messages in advance. This is useful for gateways that have a known high latency backhaul, like 3G and satellite.
- ttnGatewayEui: required(string)
- ttnGatewayId: required(string)
- poolIds: (array of string)
An array of the unique identifiers of the pools to which the gateway integrations will be attached.
Example:
{
"appVersionName": "q4hhh0cckgmc6ivflvag-v2",
"gateways": [
{
"ttnGatewayId": "dranginotest",
"name": "Farm 1 gateway integration",
"description": "Greenhouse 1",
"endpointMetadata": {
"name": "LoRa farm gateway 1",
"serial": "GA53627434"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
],
"ttnGatewayInfo": {
"ttnGatewayEui": "70B04A33D57ED0F3",
"ttnGatewayName": "Farm 1 gateway",
"frequencyPlanId": "EU_863_870_TTN",
"statusPublic": true,
"locationPublic": false,
"gatewayServerAddress": "farmtenant.eu1.cloud.thethings.industries",
"enforceDutyCycle": false,
"scheduleAnytimeDelay": 0.5
}
}
],
"registerGatewaysOnTtn": true,
"poolIds": [
"aXJuOnJjNzNkYmg3cTA6aWFtY29yZTo0YXRjaWNuaXNnOjpwb29sL2Rldg=="
]
}
HTTP status code 201
Gateway integrations are created.
Body
Media type: application/json
Type: object
Properties- createdCount: required(integer)
Count of gateway integrations with successful creation.
- failedCount: required(integer)
Count of gateway integrations with failed creation.
- created: required(array of account-gateway-integration-types.GatewayIntegrationResponse)
Array of gateway integrations with successful creation.
Items: GatewayIntegrationResponse
- id: required(integer)
The KaaIoT platform gateway integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnGatewayId: required(string)
The Things Network gateway unique identifier.
- endpointId: required(string)
The KaaIoT endpoint unique identifier.
- name: required(string)
The KaaIoT platform gateway integration name.
The human readable name to help identify the gateway integration. - description: (string)
The KaaIoT platform gateway integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- ttnGatewayInfo: (object)
Gateway information to register on The Things Network.
- ttnGatewayEui: required(string)
The Things Network gateway EUI. A 64 bit extended unique identifier for your gateway. It should be provided to you by the manufacturer, or printed on the gateway package.
- ttnGatewayName: (string)
The Things Network gateway name. An optional human readable name to help identify your gateway.
- frequencyPlanId: required(string)
The Things Network ID of the frequency plan used by this device. https://www.thethingsindustries.com/docs/reference/frequency-plans/
- statusPublic: (boolean - default: false)
The status of this gateway may be publicly displayed.
- locationPublic: (boolean - default: false)
The location of this gateway may be publicly displayed.
- gatewayServerAddress: required(string)
The address of the Gateway Server to connect to.
- enforceDutyCycle: (boolean - default: true)
Enforcing gateway duty cycle is recommended for all gateways to respect spectrum regulations. Disable enforcing the duty cycle only in controlled research and development environments.
- scheduleAnytimeDelay: (number - default: 0.53)
Adjust the time that GS schedules class C messages in advance. This is useful for gateways that have a known high latency backhaul, like 3G and satellite.
- ttnGatewayEui: required(string)
- status: required(one of ACTIVE, SUSPENDED)
Gateway integration status.
- id: required(integer)
- failed: required(array of account-gateway-integration-types.GatewayIntegrationFailedResponse)
Array of gateway integrations with failed creation.
Items: GatewayIntegrationFailedResponse
- ttnGatewayId: required(string)
The Things Network gateway unique identifier.
- reason: (string)
Cause of failing gateway integration creation.
- ttnGatewayId: required(string)
Example:
{
"createdCount": 1,
"failedCount": 1,
"created": [
{
"id": 10,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnGatewayId": "eui-1b789bc1325a5",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Farm 1 gateway",
"description": "Greenhouse 1",
"endpointMetadata": {
"name": "LoRa farm gateway 1",
"serial": "GA53627434"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
],
"ttnGatewayInfo": {
"ttnGatewayEui": "70B04A33D57ED0F3",
"ttnGatewayName": "Farm 1 gateway",
"frequencyPlanId": "EU_863_870_TTN",
"statusPublic": true,
"locationPublic": false,
"gatewayServerAddress": "farmtenant.eu1.cloud.thethings.industries",
"enforceDutyCycle": false,
"scheduleAnytimeDelay": 0.5
},
"status": "ACTIVE"
}
],
"failed": [
{
"ttnGatewayId": "eui-1b789bc1325b8",
"reason": "Can't create endpoint for gatewayIntegrationId [303], appVersionName [0cckq4hhhgmc6ivflvag-v1]"
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /account-integrations/{accountIntegrationId}/gateways
Returns all gateway integrations inside account integration. If 'status' parameter not used, then returns only ACTIVE gateway integrations.
- ttn-gateway-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 200
Gateway integrations are successfully retrieved.
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of account-gateway-integration-types.GatewayIntegrationResponse)
Items: GatewayIntegrationResponse
- id: required(integer)
The KaaIoT platform gateway integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnGatewayId: required(string)
The Things Network gateway unique identifier.
- endpointId: required(string)
The KaaIoT endpoint unique identifier.
- name: required(string)
The KaaIoT platform gateway integration name.
The human readable name to help identify the gateway integration. - description: (string)
The KaaIoT platform gateway integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- ttnGatewayInfo: (object)
Gateway information to register on The Things Network.
- ttnGatewayEui: required(string)
The Things Network gateway EUI. A 64 bit extended unique identifier for your gateway. It should be provided to you by the manufacturer, or printed on the gateway package.
- ttnGatewayName: (string)
The Things Network gateway name. An optional human readable name to help identify your gateway.
- frequencyPlanId: required(string)
The Things Network ID of the frequency plan used by this device. https://www.thethingsindustries.com/docs/reference/frequency-plans/
- statusPublic: (boolean - default: false)
The status of this gateway may be publicly displayed.
- locationPublic: (boolean - default: false)
The location of this gateway may be publicly displayed.
- gatewayServerAddress: required(string)
The address of the Gateway Server to connect to.
- enforceDutyCycle: (boolean - default: true)
Enforcing gateway duty cycle is recommended for all gateways to respect spectrum regulations. Disable enforcing the duty cycle only in controlled research and development environments.
- scheduleAnytimeDelay: (number - default: 0.53)
Adjust the time that GS schedules class C messages in advance. This is useful for gateways that have a known high latency backhaul, like 3G and satellite.
- ttnGatewayEui: required(string)
- status: required(one of ACTIVE, SUSPENDED)
Gateway integration status.
- id: required(integer)
Example:
{
"totalElements": 1,
"content": [
{
"id": 10,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnGatewayId": "dranginotest",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Moisture monitor 1",
"description": "",
"endpointMetadata": {
"name": "LoRa farm gateway 1",
"serial": "GA53627434"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
],
"ttnGatewayInfo": {
"ttnGatewayEui": "70B04A33D57ED0F3",
"ttnGatewayName": "Farm 1 gateway",
"frequencyPlanId": "EU_863_870_TTN",
"statusPublic": true,
"locationPublic": false,
"gatewayServerAddress": "farmtenant.eu1.cloud.thethings.industries",
"enforceDutyCycle": false,
"scheduleAnytimeDelay": 0.5
},
"status": "ACTIVE"
}
]
}
HTTP status code 404
Account integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Updates gateway integration.
patch /account-integrations/{accountIntegrationId}/gateways/{gatewayIntegrationId}
Updates gateway integration.
- ttn-gateway-integration:update
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
- gatewayIntegrationId: required(integer)
Gateway integration ID
Example:
142
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- name: (string)
The KaaIoT platform gateway integration name.
- description: (string)
The KaaIoT platform gateway integration description.
Example:
{
"name": "Farm 1 gateway",
"description": "Greenhouse 1"
}
HTTP status code 200
Gateway integration is successfully updated.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
The KaaIoT platform gateway integration unique identifier.
- appVersionName: required(string)
The KaaIoT platform application version name.
- ttnGatewayId: required(string)
The Things Network gateway unique identifier.
- endpointId: required(string)
The KaaIoT endpoint unique identifier.
- name: required(string)
The KaaIoT platform gateway integration name.
The human readable name to help identify the gateway integration. - description: (string)
The KaaIoT platform gateway integration description.
- endpointMetadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointRelations: (array of ttnc-api-types.EndpointRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
- ttnGatewayInfo: (object)
Gateway information to register on The Things Network.
- ttnGatewayEui: required(string)
The Things Network gateway EUI. A 64 bit extended unique identifier for your gateway. It should be provided to you by the manufacturer, or printed on the gateway package.
- ttnGatewayName: (string)
The Things Network gateway name. An optional human readable name to help identify your gateway.
- frequencyPlanId: required(string)
The Things Network ID of the frequency plan used by this device. https://www.thethingsindustries.com/docs/reference/frequency-plans/
- statusPublic: (boolean - default: false)
The status of this gateway may be publicly displayed.
- locationPublic: (boolean - default: false)
The location of this gateway may be publicly displayed.
- gatewayServerAddress: required(string)
The address of the Gateway Server to connect to.
- enforceDutyCycle: (boolean - default: true)
Enforcing gateway duty cycle is recommended for all gateways to respect spectrum regulations. Disable enforcing the duty cycle only in controlled research and development environments.
- scheduleAnytimeDelay: (number - default: 0.53)
Adjust the time that GS schedules class C messages in advance. This is useful for gateways that have a known high latency backhaul, like 3G and satellite.
- ttnGatewayEui: required(string)
- status: required(one of ACTIVE, SUSPENDED)
Gateway integration status.
Example:
{
"id": 102,
"appVersionName": "0cckq4hhhgmc6ivflvag-v1",
"ttnGatewayId": "dranginotest",
"endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
"name": "Moisture monitor 1",
"description": "",
"endpointMetadata": {
"name": "LoRa farm gateway 1",
"serial": "GA53627434"
},
"endpointRelations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
],
"ttnGatewayInfo": {
"ttnGatewayEui": "70B04A33D57ED0F3",
"ttnGatewayName": "Farm 1 gateway",
"frequencyPlanId": "EU_863_870_TTN",
"statusPublic": true,
"locationPublic": false,
"gatewayServerAddress": "farmtenant.eu1.cloud.thethings.industries",
"enforceDutyCycle": false,
"scheduleAnytimeDelay": 0.5
},
"status": "ACTIVE"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Gateway integration not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Sets the current gateway integration status. For now, allowed status transitions are:
- Active → Suspended
put /account-integrations/{accountIntegrationId}/gateways/{gatewayIntegrationId}/status
Sets the current gateway integration status. For now, allowed status transitions are:
- Active → Suspended
- ttn-gateway-integration:update
- endpoint:update
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- accountIntegrationId: required(integer)
Account integration ID
Example:
25
- gatewayIntegrationId: required(integer)
Gateway integration ID
Example:
142
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
Body
Media type: application/json
Type: object
Properties- status: required(SUSPENDED)
The status of the gateway integration.
- SUSPENDED - gateway integration is suspended
Example:
{
"status": "SUSPENDED"
}
HTTP status code 204
Gateway integration status is successfully updated.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
The Things Network
Returns TTN application with specified ID if it is accessible with current credentials.
post /ttn/applications/{id}
Returns TTN application with specified ID if it is accessible with current credentials.
URI Parameters
- id: required(string)
TTN application ID
Example:
lorawan-smart-farm
Body
Media type: application/json
Type: object
Properties- username: required(string)
The Things Network username (https://www.thethingsindustries.com/docs/integrations/mqtt/#note-on-using-the-tenant-id).
- apiKeyId: required(string)
The Things Network application API key.
- identityServerHost: required(string)
The Things Network Identity Server host address.
Example:
{
"username": "lorawan-smart-farm@ttn",
"apiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
"identityServerHost": "farmtenant.eu1.cloud.thethings.industries"
}
HTTP status code 200
TTN application is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- applicationId: required(string)
The Things Network application unique identifier.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the application was created.
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the application was updated.
- name: required(string)
The Things Network application name.
- description: (string)
The Things Network application description.
- attributes: (object)
The Things Network application attributes. Application attributes consist of multiple key-value pairs <string, string>.
Example:
{
"applicationId": "farm-app-id",
"createdAt": "2021-12-20T14:07:10.599Z",
"updatedAt": "2022-02-01T14:00:19.911Z",
"name": "Farm application",
"description": "Farm sensors"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Returns all TTN devices available for the current application integration.
get /ttn/integrations/{id}/devices
Returns all TTN devices available for the current application integration.
- ttn-app-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- id: required(integer)
Application integration ID
Example:
351
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 200
TTN devices are successfully retrieved.
Body
Media type: application/json
Type: array of object
Items: TtnDeviceResponse
- deviceId: required(string)
The Things Network device unique identifier.
- applicationId: required(string)
The Things Network application unique identifier.
- deviceEui: required(string)
The Things Network device EUI.
- joinEui: required(string)
The Things Network join EUI.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the device was created.
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the device was updated.
- name: required(string)
The Things Network device name.
- description: (string)
The Things Network device description.
- attributes: (object)
The Things Network device attributes. Device attributes consist of multiple key-value pairs <string, string>.
- location: (object)
The Things Network device location.
- latitude: (number)
The Things Network device latitude.
- longitude: (number)
The Things Network device longitude.
- altitude: (number)
The Things Network device altitude.
- source: (string)
The Things Network device source.
- latitude: (number)
Example:
[
{
"deviceId": "eui-70b3d57ed004a3f3",
"applicationId": "ttn-app-id",
"deviceEui": "70B3D57ED004A3F3",
"joinEui": "D004A3F370B3D57E",
"createdAt": "2021-12-20T14:07:10.599Z",
"updatedAt": "2022-02-01T14:00:19.911Z",
"name": "Room",
"description": "Room temperature sensor",
"attributes": {
"alarm": "on"
},
"location": {
"latitude": 51.49426750477876,
"longitude": 31.29522889852524,
"altitude": 20.0,
"source": "SOURCE_REGISTRY"
}
},
{
"deviceId": "eui-70b3d57ed004a3f5",
"applicationId": "ttn-app-id",
"deviceEui": "70B3D57ED004A3F5",
"joinEui": "D004A3F370B3D57E",
"createdAt": "2021-12-20T14:07:10.599Z",
"updatedAt": "2022-02-01T14:00:19.911Z",
"name": "Kitchen"
}
]
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns all TTN gateways available for the current gateway integration.
get /ttn/account-integrations/{id}/gateways
Returns all TTN gateways available for the current gateway integration.
- ttn-account-integration:read
TTNC supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- id: required(integer)
Account integration ID
Example:
25
Headers
- Authorization: required(string)
Used to send an OAuth 2.0 JWT.
Example:
Authorization: bearer {your-access-token}
HTTP status code 200
TTN gateways are successfully retrieved.
Body
Media type: application/json
Type: array of object
Items: TtnGatewaysResponse
- gatewayId: required(string)
The Things Network gateway unique identifier.
- gatewayEui: required(string)
Gateway EUI (Extended Unique Identifier).
- name: required(string)
The Things Network gateway name.
- description: (string)
The Things Network gateway description.
- createdAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the gateway was created.
- updatedAt: required(datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the gateway was updated.
- deletedAt: (datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the gateway was deleted (if it is deleted).
- gatewayServerAddress: (string)
The Things Network gateway server host.
- frequencyPlanId: (string)
The Things Network gateway frequency plan ID.
Example:
[
{
"gatewayId": "dranginotest",
"gatewayEui": "A8FF241DCFF1AC40",
"name": "gateway-dragino-1",
"createdAt": "2022-04-27T15:14:37.254Z",
"updatedAt": "2023-01-17T09:06:26.106581Z",
"gatewayServerAddress": "eu1.cloud.thethings.network",
"frequencyPlanId": "EU_863_870_TTN"
},
{
"gatewayId": "eui-70b3d57ed004a3f3",
"gatewayEui": "70B3D57ED004A3F3",
"name": "gateway-dragino-2",
"createdAt": "2022-09-14T11:58:59.959263Z",
"updatedAt": "2022-10-17T10:48:07.862799Z"
}
]
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Resource not found or querying user is not authorized for it.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Verify input credentials.
post /ttn/verification
Verify input credentials.
Body
Media type: application/json
Type: object
Properties- username: required(string)
The Things Network username.
- apiKeyId: required(string)
The Things Network application API key.
- plainMqttServerUrl: required(string)
The Things Network Plain MQTT Server URL.
Example:
{
"username": "lorawan-smart-farm@ttn",
"apiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
"plainMqttServerUrl": "eu1.cloud.thethings.network:1883"
}