Here is new documentation version.
You are reading outdated documentation, which will be shutdown soon!

REST API

The Things Network Connector REST API documentation version v1

https://cloud.kaaiot.com/ttnc/api/v1

Integrations

/integrations post get

post /integrations

Creates new application integration and returns it.
Application integration links a TTN application with a corresponding application in the KaaIoT platform.

Secured by oauth_2_0 with scopes:
  • 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: optional (string)

    The Things Network (TTN) Network Server host address.
    If not configured that ttnIdentityServerHost will be used instead.

  • ttnJoinServerHost: optional (string)

    The Things Network Join Server host address.
    If not configured that ttnIdentityServerHost will be used instead.

  • ttnApplicationServerHost: optional (string)

    The Things Network Application Server host address.
    If not configured that ttnIdentityServerHost will be used instead.

  • ttnPlainMqttServerUrl: optional (string)

    The Things Network MQTT Server URL address.
    Should be configured if MQTT integration is enabled.

  • ttnMqttIntegrationEnabled: optional (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 to false.
    The ttnPlainMqttServerUrl is not used when ttnMqttIntegrationEnabled is false.

  • name: required(string)

    Application integration name.

  • description: optional (string)

    Application integration description.

  • poolIds: optional (array of )

    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: optional (string)

    The Things Network (TTN) Network Server host address.

  • ttnJoinServerHost: optional (string)

    The Things Network Join Server host address.

  • ttnApplicationServerHost: optional (string)

    The Things Network Application Server host address.

  • ttnPlainMqttServerUrl: optional (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: optional (string)

    Application integration description.

  • status: required(one of ACTIVE, SUSPENDED)

    Application integration status.

  • poolIds: optional (array of )

    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: optional (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.

Secured by oauth_2_0 with scopes:
  • 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: optional (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 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: optional (string)

      The Things Network (TTN) Network Server host address.

    • ttnJoinServerHost: optional (string)

      The Things Network Join Server host address.

    • ttnApplicationServerHost: optional (string)

      The Things Network Application Server host address.

    • ttnPlainMqttServerUrl: optional (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: optional (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: optional (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: optional (string)

      Error description (if there is any problem with the KPC MQTT connection for the tenant).

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: optional (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.

/integrations/{appIntegrationId} get patch delete

get /integrations/{appIntegrationId}

Returns application integration.

Secured by oauth_2_0 with scopes:
  • 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: optional (string)

    The Things Network (TTN) Network Server host address.

  • ttnJoinServerHost: optional (string)

    The Things Network Join Server host address.

  • ttnApplicationServerHost: optional (string)

    The Things Network Application Server host address.

  • ttnPlainMqttServerUrl: optional (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: optional (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: optional (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: optional (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: optional (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.

Secured by oauth_2_0 with scopes:
  • 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: optional (string)

    The Things Network (TTN) Network Server host address.

  • ttnJoinServerHost: optional (string)

    The Things Network Join Server host address.

  • ttnApplicationServerHost: optional (string)

    The Things Network Application Server host address.

  • ttnApiKeyId: optional (string)

    The Things Network application API key.

  • name: optional (string)

    Application integration name.

  • description: optional (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: optional (string)

    The Things Network (TTN) Network Server host address.

  • ttnJoinServerHost: optional (string)

    The Things Network Join Server host address.

  • ttnApplicationServerHost: optional (string)

    The Things Network Application Server host address.

  • ttnPlainMqttServerUrl: optional (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: optional (string)

    Application integration description.

  • status: required(one of ACTIVE, SUSPENDED)

    Application integration status.

  • poolIds: optional (array of )

    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: optional (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.

Secured by oauth_2_0 with scopes:
  • 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: optional (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.

/integrations/{appIntegrationId}/devices post get

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.

Secured by oauth_2_0 with scopes:
  • 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 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: optional (string)

      Device integration description.

    • endpointMetadata: optional (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: optional (array of EndpointRelation)

        Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

          Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

        • to: optional (string)

          Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

    • poolIds: optional (array of )

      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 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: optional (string)

        Device integration description.

      • status: required(one of ACTIVE, SUSPENDED)

        Device integration status.

    • failed: required(array of DevIntegrationFailedResponse)

      Array of device integrations with failed creation.

      Items: DevIntegrationFailedResponse

      • ttnDeviceId: required(string)

        The Things Network device unique identifier.

      • reason: optional (string)

        Cause of failing device integration creation.

    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: optional (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.

    Secured by oauth_2_0 with scopes:
    • 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: optional (number - default: 0)

      Page number.

      Example:

      0
    • size: optional (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 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: optional (string)

        Device integration description.

      • status: required(one of ACTIVE, SUSPENDED)

        Device integration status.

    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: optional (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.

    /integrations/{appIntegrationId}/devices/batch post

    post /integrations/{appIntegrationId}/devices/batch

    Create a task to register a batch of device integrations within a specified application integration.

    Secured by oauth_2_0 with scopes:
    • 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 BatchDevIntegrationItemCreate)

      Items: BatchDevIntegrationItemCreate

      • ttnDeviceId: optional (string)

        The Things Network device unique identifier. If not explicitly provided, the device identifier is automatically generated in the format:
        eui-<device EUI> (e.g., eui-70b3d57ed005eabc).

      • 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: optional (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: optional (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: optional (boolean - default: true)

        The device supports join (OTAA).

      • multicast: optional (boolean - default: false)

        Indicates whether this device represents a multicast group.

      • supportsClassB: optional (boolean - default: false)

        Whether the device supports class B.

      • supportsClassC: optional (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.

        • rx2_data_rate_index: required(number)

          Data rate index for Rx2. If unset, the default value from Network Server configuration or regional parameters specification will be used.

        • rx2_frequency: required(string)

          Frequency for Rx2 (Hz). If unset, the default value from Network Server configuration or regional parameters specification will be used.

      • ttnDeviceName: optional (string)

        TTN Device name.

      • ttnDeviceDescription: optional (string)

        TTN Device description.

      • name: required(string)

        Device integration name.

      • description: optional (string)

        Device integration description.

      • endpointMetadata: optional (object)

        Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

        • endpointRelations: optional (array of EndpointRelation)

          Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

            Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

          • to: optional (string)

            Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

      • poolIds: optional (array of )

        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": {
              "rx2_data_rate_index": 0,
              "rx2_frequency": "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: optional (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.

      /integrations/{appIntegrationId}/devices/batch/status get

      get /integrations/{appIntegrationId}/devices/batch/status

      Returns batch device integration registration task status.

      Secured by oauth_2_0 with scopes:
      • 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 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: optional (string)

          TTN Device name.

        • ttnDeviceDescription: optional (string)

          TTN Device description.

        • name: required(string)

          Device integration name.

        • description: optional (string)

          Device integration description.

        • endpointMetadata: optional (object)

          Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

          • endpointRelations: optional (array of EndpointRelation)

            Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

              Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

            • to: optional (string)

              Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

        • failed: required(array of 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: optional (string)

            Cause of failing device integration creation.

        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: optional (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.

        /integrations/{appIntegrationId}/devices/{devIntegrationId} get patch

        get /integrations/{appIntegrationId}/devices/{devIntegrationId}

        Returns device integration.

        Secured by oauth_2_0 with scopes:
        • 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: optional (string)

          Device integration description.

        • endpointMetadata: optional (object)

          Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

          • endpointRelations: optional (array of EndpointRelation)

            Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

              Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

            • to: optional (string)

              Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

          • 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: optional (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.

          Secured by oauth_2_0 with scopes:
          • 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: optional (string)

            Device integration name.

          • description: optional (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: optional (string)

            Device integration description.

          • endpointMetadata: optional (object)

            Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

            • endpointRelations: optional (array of EndpointRelation)

              Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

                Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

              • to: optional (string)

                Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

            • 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: optional (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.

            /integrations/{appIntegrationId}/devices/{devIntegrationId}/status put

            put /integrations/{appIntegrationId}/devices/{devIntegrationId}/status

            Sets the current device integration status. For now, allowed status transitions are:

            • Active → Suspended
            Secured by oauth_2_0 with scopes:
            • 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: optional (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

            /account-integrations post get

            post /account-integrations

            Creates new account integration and returns it.
            Account integration provides access to TTN gateways metadata and statistics (TTN account-level information).

            Secured by oauth_2_0 with scopes:
            • 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: optional (string)

              The KaaIoT platform account integration description.

            • poolIds: optional (array of )

              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: optional (string)

              Account integration description.

            • status: required(one of ACTIVE, SUSPENDED)

              Account integration status.

            • error: optional (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: optional (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.

            Secured by oauth_2_0 with scopes:
            • 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: optional (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 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: optional (string)

                Account integration description.

              • status: required(one of ACTIVE, SUSPENDED)

                Account integration status.

              • error: optional (string)

                Error description (if there is any problem with the TTN or KPC connection).

            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: optional (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/{accountIntegrationId} get patch delete

            get /account-integrations/{accountIntegrationId}

            Returns account integration.

            Secured by oauth_2_0 with scopes:
            • 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: optional (string)

              Account integration description.

            • status: required(one of ACTIVE, SUSPENDED)

              Account integration status.

            • error: optional (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: optional (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.

            Secured by oauth_2_0 with scopes:
            • 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: optional (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: optional (string)

              The KaaIoT platform account integration name.

            • description: optional (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: optional (string)

              Account integration description.

            • status: required(one of ACTIVE, SUSPENDED)

              Account integration status.

            • error: optional (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: optional (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.

            Secured by oauth_2_0 with scopes:
            • 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: optional (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/{accountIntegrationId}/gateways post get

            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.

            Secured by oauth_2_0 with scopes:
            • 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: optional (boolean - default: false)

              Used in case when we want to create not only gateway integration on KaaIoT platform but the gateway on the TTN.
              If true then ttnGatewayInfo should be configured for the gateways.

            • gateways: required(array of 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: optional (string)

                The KaaIoT platform gateway integration description.

              • endpointMetadata: optional (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: optional (array of EndpointRelation)

                  Endpoint relation with other endpoints.
                  Only one of the directions - either to or from, must be specified in each relation entry.
                  For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

                    Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

                  • to: optional (string)

                    Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

                • ttnGatewayInfo: optional (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: optional (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: optional (boolean - default: false)

                    The status of this gateway may be publicly displayed.

                  • locationPublic: optional (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: optional (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: optional (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.

              • poolIds: optional (array of )

                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 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: optional (string)

                  The KaaIoT platform gateway integration description.

                • endpointMetadata: optional (object)

                  Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

                  • endpointRelations: optional (array of EndpointRelation)

                    Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

                      Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

                    • to: optional (string)

                      Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

                  • ttnGatewayInfo: optional (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: optional (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: optional (boolean - default: false)

                      The status of this gateway may be publicly displayed.

                    • locationPublic: optional (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: optional (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: optional (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.

                  • status: required(one of ACTIVE, SUSPENDED)

                    Gateway integration status.

                • failed: required(array of GatewayIntegrationFailedResponse)

                  Array of gateway integrations with failed creation.

                  Items: GatewayIntegrationFailedResponse

                  • ttnGatewayId: required(string)

                    The Things Network gateway unique identifier.

                  • reason: optional (string)

                    Cause of failing gateway integration creation.

                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: optional (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.

                Secured by oauth_2_0 with scopes:
                • 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 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: optional (string)

                    The KaaIoT platform gateway integration description.

                  • endpointMetadata: optional (object)

                    Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

                    • endpointRelations: optional (array of EndpointRelation)

                      Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

                        Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

                      • to: optional (string)

                        Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

                    • ttnGatewayInfo: optional (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: optional (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: optional (boolean - default: false)

                        The status of this gateway may be publicly displayed.

                      • locationPublic: optional (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: optional (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: optional (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.

                    • status: required(one of ACTIVE, SUSPENDED)

                      Gateway integration status.

                  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: optional (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/{accountIntegrationId}/gateways/{gatewayIntegrationId} patch

                  patch /account-integrations/{accountIntegrationId}/gateways/{gatewayIntegrationId}

                  Updates gateway integration.

                  Secured by oauth_2_0 with scopes:
                  • 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: optional (string)

                    The KaaIoT platform gateway integration name.

                  • description: optional (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: optional (string)

                    The KaaIoT platform gateway integration description.

                  • endpointMetadata: optional (object)

                    Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.

                    • endpointRelations: optional (array of EndpointRelation)

                      Endpoint relation with other endpoints. Only one of the directions - either to or from, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation type contains - 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: optional (string)

                        Endpoint ID having the outbound direction of relation type coming to the registering endpoint.

                      • to: optional (string)

                        Endpoint ID having the inbound direction of relation type coming from the registering endpoint.

                    • ttnGatewayInfo: optional (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: optional (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: optional (boolean - default: false)

                        The status of this gateway may be publicly displayed.

                      • locationPublic: optional (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: optional (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: optional (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.

                    • 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: optional (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/{accountIntegrationId}/gateways/{gatewayIntegrationId}/status put

                    put /account-integrations/{accountIntegrationId}/gateways/{gatewayIntegrationId}/status

                    Sets the current gateway integration status. For now, allowed status transitions are:

                    • Active → Suspended
                    Secured by oauth_2_0 with scopes:
                    • 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: optional (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

                    /ttn/applications/{id} post

                    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

                    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: optional (string)

                      The Things Network application description.

                    • attributes: optional (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.

                      /ttn/integrations/{id}/devices get

                      get /ttn/integrations/{id}/devices

                      Returns all TTN devices available for the current application integration.

                      Secured by oauth_2_0 with scopes:
                      • 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 TtnDeviceResponse

                      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: optional (string)

                        The Things Network device description.

                      • attributes: optional (object)

                        The Things Network device attributes. Device attributes consist of multiple key-value pairs <string, string>.

                        • location: optional (object)

                          The Things Network device location.

                          • latitude: optional (number)

                            The Things Network device latitude.

                          • longitude: optional (number)

                            The Things Network device longitude.

                          • altitude: optional (number)

                            The Things Network device altitude.

                          • source: optional (string)

                            The Things Network device source.

                        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: optional (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.

                        /ttn/integrations/{id}/devices/search get

                        get /ttn/integrations/{id}/devices/search

                        Searches TTN devices available for the current application integration. If all query parameters are omitted, all TTN devices are returned.

                        Secured by oauth_2_0 with scopes:
                        • 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}

                        Query Parameters

                        • deviceId: optional (string)

                          Filters devices whose TTN device ID contains the specified substring.

                          Example:

                          eui-70b3
                        • name: optional (string)

                          Filters devices whose name contains the specified substring.

                          Example:

                          sensor
                        • deviceEui: optional (string)

                          Filters devices by Device EUI (16 hexadecimal characters).

                          Example:

                          70B3D57ED004A3F3
                        • joinEui: optional (string)

                          Filters devices by Join EUI (16 hexadecimal characters).

                          Example:

                          D004A3F370B3D57E

                        HTTP status code 200

                        TTN devices are successfully retrieved.

                        Body

                        Media type: application/json

                        Type: array of TtnDeviceResponse

                        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: optional (string)

                          The Things Network device description.

                        • attributes: optional (object)

                          The Things Network device attributes. Device attributes consist of multiple key-value pairs <string, string>.

                          • location: optional (object)

                            The Things Network device location.

                            • latitude: optional (number)

                              The Things Network device latitude.

                            • longitude: optional (number)

                              The Things Network device longitude.

                            • altitude: optional (number)

                              The Things Network device altitude.

                            • source: optional (string)

                              The Things Network device source.

                          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"
                              }
                            }
                          ]
                          

                          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: optional (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.

                          /ttn/account-integrations/{id}/gateways get

                          get /ttn/account-integrations/{id}/gateways

                          Returns all TTN gateways available for the current gateway integration.

                          Secured by oauth_2_0 with scopes:
                          • 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 TtnGatewaysResponse

                          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: optional (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: optional (datetime)

                            Timestamp in ISO 8601 format (UTC timezone) showing when the gateway was deleted (if it is deleted).

                          • gatewayServerAddress: optional (string)

                            The Things Network gateway server host.

                          • frequencyPlanId: optional (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: optional (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.

                          /ttn/verification post

                          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"
                          }
                          

                          HTTP status code 200

                          Credencials are successfully verified.

                          HTTP status code 400

                          Invalid request.

                          Body

                          Media type: application/json

                          Type: object

                          Properties

                          • message: required(string)

                            Detailed error description.