REST API

The Things Network Connector REST API documentation version v1

{schema}://{host}/api/{version}

  • schema: required(one of http, https - default: http)
  • host: required(string - default: localhost)
  • version: required(v1)

Integrations

/integrations post get

post /integrations

Creates new application integration and returns it.

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)

    Kaa platform application name.

  • ttnUsername: required(string)

    The Things Network username.

  • ttnApiKeyId: required(string)

    The Things Network application API key.

  • ttnIdentityServerHost: required(string)

    The Things Network Identity Server host address.

  • ttnPlainMqttServerUrl: required(string)

    The Things Network MQTT Server URL address.

  • name: required(string)

    Application integration name.

  • description: optional (string)

    Application integration description.

Example:

{
  "appName": "q4hhh0cckgmc6ivflvag",
  "ttnUsername": "lorawan-smart-user@ttn",
  "ttnApiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
  "ttnIdentityServerHost": "farmtenant.eu1.cloud.thethings.industries",
  "ttnPlainMqttServerUrl": "eu2.cloud.thethings.industries:1883",
  "name": "Smart Farm",
  "description": "Smart farm LoRaWAN devices integration"
}

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)

    Kaa platform application name.

  • ttnUsername: required(string)

    The Things Network username.

  • ttnIdentityServerHost: required(string)

    The Things Network Identity Server host address.

  • ttnPlainMqttServerUrl: required(string)

    The Things Network MQTT Server URL address.

  • name: required(string)

    Application integration name.

  • description: optional (string)

    Application integration description.

  • status: required(one of ACTIVE, SUSPENDED)

    Application integration status.

Example:

{
  "id": 267,
  "appName": "q4hhh0cckgmc6ivflvag",
  "ttnUsername": "lorawan-smart-user@ttn",
  "ttnIdentityServerHost": "eu1.cloud.thethings.network",
  "ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
  "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

  • applicationName: optional (string)

    Filters applications integrations by application name.

    Example:

    my-application
  • status: optional (one of ACTIVE, SUSPENDED - default: ACTIVE)

    Application integration status.

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 AppIntegrationExtResponse)

    Items: AppIntegrationExtResponse

    • id: required(integer)

      Application integration unique identifier.

    • appName: required(string)

      Kaa platform application name.

    • ttnUsername: required(string)

      The Things Network username.

    • ttnIdentityServerHost: required(string)

      The Things Network Identity Server host address.

    • ttnPlainMqttServerUrl: required(string)

      The Things Network MQTT Server URL address.

    • name: required(string)

      Application integration name.

    • description: optional (string)

      Application integration description.

    • status: required(one of ACTIVE, SUSPENDED)

      Application integration status.

    • state: required(one of CONNECTED, DISCONNECTED)

      Application integration TTN MQTT connection state.

      • `CONNECTED` - connection successful
      • `DISCONNECTED` - There is some problem with the connection

    • error: optional (string)

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

Example:

{
  "totalElements": 2,
  "content": [
    {
      "id": 267,
      "appName": "q4hhh0cckgmc6ivflvag",
      "ttnUsername": "lorawan-smart-user@ttn",
      "ttnIdentityServerHost": "eu1.cloud.thethings.network",
      "ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
      "name": "Smart Farm",
      "description": "Smart farm LoRaWAN devices integration",
      "status": "ACTIVE",
      "state": "CONNECTED"
    },
    {
      "id": 351,
      "appName": "0cckq4hhhgmc6ivflasd",
      "ttnUsername": "lorawan-smart-user2@ttn",
      "ttnIdentityServerHost": "farmtenant.eu1.cloud.thethings.industries",
      "ttnPlainMqttServerUrl": "eu2.cloud.thethings.industries:1883",
      "name": "Smart Farm",
      "description": "Smart farm LoRaWAN devices integration",
      "status": "SUSPENDED",
      "state": "DISCONNECTED",
      "error": "Not authorized to connect"
    }
  ]
}

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)

    Kaa platform application name.

  • ttnUsername: required(string)

    The Things Network username.

  • ttnIdentityServerHost: required(string)

    The Things Network Identity Server host address.

  • ttnPlainMqttServerUrl: required(string)

    The Things Network MQTT Server URL address.

  • name: required(string)

    Application integration name.

  • description: optional (string)

    Application integration description.

  • status: required(one of ACTIVE, SUSPENDED)

    Application integration status.

  • state: required(one of CONNECTED, DISCONNECTED)

    Application integration TTN MQTT connection state.

    • `CONNECTED` - connection successful
    • `DISCONNECTED` - There is some problem with the connection

  • error: optional (string)

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

  • devices: required(array of DeviceIntegrationResponse)

    List of already integrated devices.

    Items: DeviceIntegrationResponse

    • id: required(integer)

      Device integration unique identifier.

    • appVersionName: required(string)

      Kaa 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:

{
  "id": 351,
  "appName": "0cckq4hhhgmc6ivflvag",
  "ttnUsername": "lorawan-smart-user2@ttn",
  "ttnIdentityServerHost": "farmtenant.eu1.cloud.thethings.industries",
  "ttnPlainMqttServerUrl": "eu2.cloud.thethings.industries:1883",
  "name": "Smart Farm",
  "description": "Smart farm LoRaWAN devices integration",
  "state": "DISCONNECTED",
  "error": "Unable to connect to server",
  "status": "ACTIVE",
  "devices": [
    {
      "id": 102,
      "appVersionName": "0cckq4hhhgmc6ivflvag-v1",
      "ttnDeviceId": "eui-1b789bc1325a5",
      "endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
      "name": "Moisture monitor 1"
    },
    {
      "id": 105,
      "appVersionName": "0cckq4hhhgmc6ivflvag-v2",
      "ttnDeviceId": "eui-1b789bc1325a6",
      "endpointId": "78126304-4970-4f80-91a1-06e9ae2b7445",
      "name": "Moisture monitor 2"
    }
  ]
}

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

  • ttnApiKeyId: optional (string)

    The Things Network application API key.

  • name: optional (string)

    Application integration name.

  • description: optional (string)

    Application integration description.

Example:

{
  "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)

    Kaa platform application name.

  • ttnUsername: required(string)

    The Things Network username.

  • ttnIdentityServerHost: required(string)

    The Things Network Identity Server host address.

  • ttnPlainMqttServerUrl: required(string)

    The Things Network MQTT Server URL address.

  • name: required(string)

    Application integration name.

  • description: optional (string)

    Application integration description.

  • status: required(one of ACTIVE, SUSPENDED)

    Application integration status.

Example:

{
  "id": 267,
  "appName": "q4hhh0cckgmc6ivflvag",
  "ttnUsername": "lorawan-smart-user@ttn",
  "ttnIdentityServerHost": "eu1.cloud.thethings.network",
  "ttnPlainMqttServerUrl": "eu1.cloud.thethings.network:1883",
  "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).

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)

    Kaa platform application version name that integrated devices should work in.

  • devices: required(array of CreateDeviceIntegrationItem)

    List of devices to create integration for.

    Items: CreateDeviceIntegrationItem

    • ttnDeviceId: required(string)

      The Things Network device unique identifier.

    • name: required(string)

      Device integration name.

    • description: optional (string)

      Device integration description.

Example:

{
  "appVersionName": "q4hhh0cckgmc6ivflvag-v2",
  "devices": [
    {
      "ttnDeviceId": "eui-1b789bc1325f8",
      "name": "Moisture monitor",
      "description": "Greenhouse 1"
    }
  ]
}

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 DeviceIntegrationResponse)

    Array of device integrations with successful creation.

    Items: DeviceIntegrationResponse

    • id: required(integer)

      Device integration unique identifier.

    • appVersionName: required(string)

      Kaa 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 DeviceIntegrationFailedResponse)

    Array of device integrations with failed creation.

    Items: DeviceIntegrationFailedResponse

    • ttnDeviceId: required(string)

      The Things Network device unique identifier.

    • statusReason: 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 1",
      "description": "Greenhouse 1",
      "status": "ACTIVE"
    },
    {
      "id": 25,
      "appVersionName": "0cckq4hhhgmc6ivflvag-v2",
      "ttnDeviceId": "eui-1b789bc1325a6",
      "endpointId": "59126304-4970-4f80-91a1-06e9ae2b7445",
      "name": "Moisture monitor 2",
      "description": "Greenhouse 1",
      "status": "ACTIVE"
    }
  ],
  "failed": [
    {
      "ttnDeviceId": "eui-1b789bc1325b8",
      "statusReason": "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

  • status: optional (one of ACTIVE, SUSPENDED - default: ACTIVE)

    Device integration status.

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 DeviceIntegrationResponse)

    Items: DeviceIntegrationResponse

    • id: required(integer)

      Device integration unique identifier.

    • appVersionName: required(string)

      Kaa 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 1",
      "description": "Greenhouse 1",
      "status": "ACTIVE"
    },
    {
      "id": 25,
      "appVersionName": "0cckq4hhhgmc6ivflvag-v2",
      "ttnDeviceId": "eui-1b789bc1325a6",
      "endpointId": "59126304-4970-4f80-91a1-06e9ae2b7445",
      "name": "Moisture monitor 2",
      "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/{devIntegrationId} patch

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",
  "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)

    Kaa 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:

{
  "id": 10,
  "appVersionName": "0cckq4hhhgmc6ivflvag-v1",
  "ttnDeviceId": "eui-1b789bc1325a5",
  "endpointId": "59126304-4970-4f80-91a1-06e9ae2b7476",
  "name": "Moisture monitor",
  "description": "Greenhouse 1",
  "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:udpate

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(one of Active, Suspended)

    The status of the device integration.

    • Active - device integration is active
    • 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.

The Things Network

/ttn/applications post

post /ttn/applications

Returns all TTN applications accessible with current 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.

  • identityServerHost: required(string)

    The Things Network Identity Server host address.

Example:

{
  "username": "lorawan-smart-user@ttn",
  "apiKeyId": "EJXRNLCPHQEIUTZLUSVLCAK26HINNSXS.AP4VEXNNY4DGRTOXHBAZ33HFDS67B5LVW.5CHH7RJPLR5WYDIGP7KAABI5EXAMPLE",
  "identityServerHost": "farmtenant.eu1.cloud.thethings.industries"
}

HTTP status code 200

TTN applications are successfully retrieved.

Body

Media type: application/json

Type: array of TtnApplicationResponse

Items: TtnApplicationResponse

  • 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"
      },
      {
        "applicationId": "house-app-id",
        "createdAt": "2021-12-20T14:07:10.599Z",
        "updatedAt": "2022-02-01T14:00:19.911Z",
        "name": "House application"
      }
    ]
    

    HTTP status code 400

    Invalid request.

    Body

    Media type: application/json

    Type: object

    Properties

    • message: required(string)

      Detailed error description.

    /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

    • username: required(string)

      The Things Network username.

    • apiKeyId: required(string)

      The Things Network application API key.

    • identityServerHost: required(string)

      The Things Network Identity Server host address.

    Example:

    {
      "username": "lorawan-smart-user@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: array of TtnApplicationResponse

    Items: TtnApplicationResponse

    • 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"
        },
        {
          "applicationId": "house-app-id",
          "createdAt": "2021-12-20T14:07:10.599Z",
          "updatedAt": "2022-02-01T14:00:19.911Z",
          "name": "House application"
        }
      ]
      

      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/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-user@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.