Skip to main content
Version: 2.0

Connections

Introduction

Connections represent controllers that are connected to a cloud node on a local network. Each controller can operate one or more devices, which represent doors and gates (along with their accompanying readers), Aperio wireless locks, and any other devices that can be controlled with relays. There are two types of controllers:

  • PDK controllers can be connected via ethernet or WiMAC and can operate 1–24 doors, depending on the model.
  • Aperio hubs are connected via ethernet and can operate up to 64 Aperio wireless locks.

Connections are typically configured manually in pdk.io, but they can also be configured through the API.

The connection object

{
"id": "767a1e35-bd34-4858-9130-a0a1900438ed",
"name": "Test Connection",
"type": "ethernet",
"connected": true,
"protocol": "IPv6",
"ipaddress": "10.0.0.2",
"ipv6Address": "fe80::5e85:7eff:fe60:dfa",
"port": 10001,
"dhcp": true,
"netmask": null,
"gateway": null,
"dns": null,
"macAddress": "5c:85:7e:60:0d:fa",
"manufacturer": "PDK"
}
PropertyTypeDescription
idStringThe connection ID.
nameStringThe connection name.
typeStringThe connection type. Possible values include aperio, ethernet, usb, wirelessCoordinator, and wirelessGateway.
connectedBooleanThe connection status.
protocolStringThe protocol version. Possible values include IPv4 and IPv6.
ipaddressStringThe IPv4 address of the controller.
ipv6AddressStringThe IPv6 address of the controller.
portIntegerThe port number used on the controller.
dhcpBooleanWhether DHCP is enabled.
netmaskStringThe subnet mask.
gatewayStringThe gateway IP address.
dnsStringThe DNS IP address.
macaddressStringThe MAC address of the controller.
manufacturerStringThe ethernet module manufacter. Possible values include PDK and Lantronix.

Basic Endpoints

Create a connection

Request

POST https://systems.pdk.io/{{system_id}}/cloud-nodes/{{cloud_node_id}}/connections HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"name": "Test Connection",
"type": "ethernet",
"ipaddress": "10.0.0.2",
"port": 10001
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
cloud_node_idPathStringYesThe cloud node ID.
system_tokenHeaderStringYesA valid system token.
nameBodyStringYesThe connection name.
typeBodyStringYesThe connection type. Possible values include aperio, ethernet, usb, wirelessCoordinator, and wirelessGateway. The usb type is used for the on-board cloud node controller.
protocolBodyStringNoThe protocol version to use if type is set to ethernet. Possible values include IPv4 and IPv6 (default).
ipaddressBodyStringSometimesThe IPv4 address of the controller. This is required if type is set to ethernet or wirelessGateway.
ipv6AddressBodyStringNoThe IPv6 address of the controller. This only applies if type is set to ethernet.
portBodyIntegerYesThe port number to be used on the controller.
macaddressBodyStringSometimesThe MAC address of the controller. This is required when type is set to aperio.
manufacturerBodyStringNoThe ethernet module manufacter. This only applies if type is set to ethernet. Possible values include PDK and Lantronix (default).

Response

The response contains the ID of the newly created connection object.

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": "767a1e35-bd34-4858-9130-a0a1900438ed"
}

Retrieve a connection

Request

GET https://systems.pdk.io/{{system_id}}/cloud-nodes/{{cloud_node_id}}/connections/{{connection_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
cloud_node_idPathStringYesThe cloud node ID.
connection_idPathIntegerYesThe connection ID.
system_tokenHeaderStringYesA valid system token.

Response

The response contains a connection object.

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": "767a1e35-bd34-4858-9130-a0a1900438ed",
"name": "Test Connection",
"type": "ethernet",
"connected": true,
"protocol": "IPv6",
"ipaddress": "10.0.0.2",
"ipv6Address": "fe80::5e85:7eff:fe60:dfa",
"port": 10001,
"dhcp": true,
"netmask": null,
"gateway": null,
"dns": null,
"macAddress": "5c:85:7e:60:0d:fa",
"manufacturer": "PDK"
}

Update a connection

Request

PUT https://systems.pdk.io/{{system_id}}/cloud-nodes/{{cloud_node_id}}/connections/{{connection_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"name": "Test Connection",
"type": "ethernet",
"ipaddress": "10.0.0.2",
"port": 10001
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
cloud_node_idPathStringYesThe cloud node ID.
connection_idPathIntegerYesThe connection ID.
system_tokenHeaderStringYesA valid system token.
nameBodyStringYesThe connection name.
typeBodyStringYesThe connection type. Possible values include aperio, ethernet, usb, wirelessCoordinator, and wirelessGateway. The usb type is used for the on-board cloud node controller.
protocolBodyStringNoThe protocol version to use if type is set to ethernet. Possible values include IPv4 and IPv6 (default).
ipaddressBodyStringSometimesThe IPv4 address of the controller. This is required if type is set to ethernet or wirelessGateway.
ipv6AddressBodyStringNoThe IPv6 address of the controller. This only applies if type is set to ethernet.
portBodyIntegerYesThe port number to be used on the controller.
macaddressBodyStringSometimesThe MAC address of the controller. This is required when type is set to aperio.
manufacturerBodyStringNoThe ethernet module manufacter. This only applies if type is set to ethernet. Possible values include PDK and Lantronix (default).

Response

HTTP/1.1 204 No Content

Delete a connection

Request

DELETE https://systems.pdk.io/{{system_id}}/cloud-nodes/{{cloud_node_id}}/connections/{{connection_id}} HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
cloud_node_idPathStringYesThe cloud node ID.
connection_idPathIntegerYesThe connection ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 204 No Content

List all connections

Request

GET https://systems.pdk.io/{{system_id}}/connections HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
pageQueryIntegerNoThe zero-based page number used for pagination. The default value is 0.
per_pageQueryIntegerNoThe number of items per page used for pagination. The default value is 10 and the maximum value is 100.
system_tokenHeaderStringYesA valid system token.

Response

The response contains an array of connection objects.

HTTP/1.1 200 OK
Content-Type: application/json

[
{
"id": "767a1e35-bd34-4858-9130-a0a1900438ed",
"name": "Test Connection 1",
"type": "usb",
"connected": true,
"port": 1
},
{
"id": "4769e1db-d879-40b0-b968-ffaa343e982c",
"name": "Test Connection 2",
"type": "ethernet",
"connected": true,
"protocol": "IPv6",
"ipaddress": "10.0.0.2",
"ipv6Address": "fe80::5e85:7eff:fe60:dfa",
"port": 10001,
"dhcp": true,
"netmask": null,
"gateway": null,
"dns": null,
"macAddress": "5c:85:7e:60:0d:fa",
"manufacturer": "PDK"
}
]

Retrieve wireless diagnostics

Request

GET https://systems.pdk.io/{{system_id}}/cloud-nodes/{{cloud_node_id}}/diagnostics/wireless HTTP/1.1
Authorization: Bearer {{system_token}}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
cloud_node_idPathStringYesThe cloud node ID.
system_tokenHeaderStringYesA valid system token.

Response

HTTP/1.1 200 OK
Content-Type: application/json

[
{
"id": "767a1e35-bd34-4858-9130-a0a1900438ed",
"name": "Test Connection",
"type": "wirelessCoordinator",
"nodes": [
{
"name": "Test Device",
"shortAddress": "3ceb",
"address": "0013a200403e07c6",
"communicationLost": true,
"averageRtt": 4737,
"averageRetries": 0,
"failureRate": 1
}
],
"links": [
{
"from": "0000",
"to": "0013a200403e08c6",
"lqi": 255
}
]
}
]

Configure a connection

Additional network configuration options are available for PDK ethernet modules. In order to apply these options, a connection's manufacturer property must be set to PDK.

Request

POST https://systems.pdk.io/{{system_id}}/cloud-nodes/{{cloud_node_id}}/connections/{{connection_id}}/configure HTTP/1.1
Authorization: Bearer {{system_token}}
Content-Type: application/json

{
"dhcp": false,
"netmask": "255.255.255.0",
"gateway": "10.0.0.1",
"dns": "8.8.8.8"
}
ParameterLocationTypeRequiredDescription
system_idPathStringYesThe system ID.
cloud_node_idPathStringYesThe cloud node ID.
connection_idPathIntegerYesThe connection ID.
system_tokenHeaderStringYesA valid system token.
dhcpBodyBooleanYesWhether DHCP should be enabled.
netmaskBodyStringNoThe subnet mask.
gatewayBodyStringNoThe gateway IP address.
dnsBodyStringNoThe DNS IP address.

Response

HTTP/1.1 204 No Content