Connections
Connections API
Available API Paths
Path: /api/connections
Methods
GET
Returns a list of active connections
Responses
| Status | Description | Response Content or Scheme | 
| 200 | List of active connections |  | 
Example
{
  "id": "mosquitto-dev",
  "name": "Development Server",
  "url": "mqtts://url.com:1883",
  "credentials": {
    "username": "admin",
    "password": "adminpassword"
  },
  "ca": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "cert": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "key": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "rejectUnauthorized": "true",
  "status": {
    "connected": "false",
    "error": {
      "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
    }
  }
}
| Status | Description | Response Content or Scheme | 
| 401 | Access to resource is denied. User not authenticated (logged in) or session expired |  | 
| 403 | Forbidden (Connection with the same name/id already exists | Maximum number of connections reached) | User does not have access permissions |  | 
| 404 | Plugin is not enabled or not found |  | 
| 500 | An internal server error occured |  | 
POST
Creates a connection. Can be used by connectionManager or Admin roles. If a connection error occured on connection creation which is due to a misconfiguartion, a subsequent request with updated information might fix it
Parameters
| Name | Required | Type | Request Properties or Schema | 
| body | true | object |  A connection object. Properties:  | 
Example
{
  "id": "mosquitto-dev",
  "name": "Development Server",
  "url": "mqtts://url.com:1883",
  "credentials": {
    "username": "admin",
    "password": "adminpassword"
  },
  "ca": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "cert": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "key": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "rejectUnauthorized": "true"
}
Responses
| Status | Description | Response Content or Scheme | 
| 200 | List of all connections (active or inactive) |  | 
Example
{
  "id": "mosquitto-dev",
  "name": "Development Server",
  "url": "mqtts://url.com:1883",
  "credentials": {
    "username": "admin",
    "password": "adminpassword"
  },
  "ca": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "cert": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "key": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "rejectUnauthorized": "true",
  "status": {
    "connected": "false",
    "error": {
      "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
    }
  }
}
| Status | Description | Response Content or Scheme | 
| 401 | Access to resource is denied. User not authenticated (logged in) or session expired |  | 
| 403 | Forbidden (Connection with the same name/id already exists | Maximum number of connections reached) | User does not have access permissions |  | 
| 404 | Plugin is not enabled or not found |  | 
| 500 | An internal server error occured |  | 
Path: /api/connections/{connectionId}
Methods
DELETE
Deletes a specified connection and returns a list of remaining ones. Can be used by connectionManager or Admin roles
Parameters
| Name | Location | Type | Required | Description | 
|---|---|---|---|---|
| connectionId | path | string | true | Id of the connection to be deleted | 
Responses
| Status | Description | Response Content or Scheme | 
| 200 | List of remaining connections (active or inactive) |  | 
Example
{
  "id": "mosquitto-dev",
  "name": "Development Server",
  "url": "mqtts://url.com:1883",
  "credentials": {
    "username": "admin",
    "password": "adminpassword"
  },
  "ca": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "cert": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "key": {
    "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVBekNDQXV1Z0F3SUJBZ0lVQlkxaGxDR3ZkajROaEJYa1ovd...",
    "endoding": "base64"
  },
  "rejectUnauthorized": "true",
  "status": {
    "connected": "false",
    "error": {
      "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
    }
  }
}
| Status | Description | Response Content or Scheme | 
| 202 | Connection was successfully created but when attempting to connect, an error occured |  | 
| 401 | Access to resource is denied. User not authenticated (logged in) or session expired |  | 
| 403 | Forbidden (Connection with the same name/id already exists | Maximum number of connections reached) | User does not have access permissions |  | 
| 404 | Plugin is not enabled or not found |  | 
| 500 | An internal server error occured |  |