Skip to main content
Version: 1.0

Connections

Introduction

Connections represent physical controllers that are connected to a cloud node on a local network. Each controller can operate one or more devices, including doors, gates, elevators, and alarms. 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": 1,
"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
idIntegerThe 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://panel-{{panel_id}}.pdk.io/api/connections HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json

{
"name": "Test Connection",
"type": "ethernet",
"ipaddress": "10.0.0.2",
"port": 10001
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
panel_tokenHeaderStringYesA valid panel 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": 1
}

Retrieve a connection

Request

GET https://panel-{{panel_id}}.pdk.io/api/connections/{{connection_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
connection_idPathIntegerYesThe connection ID.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains a connection object.

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

{
"id": 1,
"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://panel-{{panel_id}}.pdk.io/api/connections/{{connection_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json

{
"name": "Test Connection",
"type": "ethernet",
"ipaddress": "10.0.0.2",
"port": 10001
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
connection_idPathIntegerYesThe connection ID.
panel_tokenHeaderStringYesA valid panel 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://panel-{{panel_id}}.pdk.io/api/connections/{{connection_id}} HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
connection_idPathIntegerYesThe connection ID.
panel_tokenHeaderStringYesA valid panel token.

Response

HTTP/1.1 204 No Content

List all connections

Request

GET https://panel-{{panel_id}}.pdk.io/api/connections HTTP/1.1
Authorization: Bearer {{panel_token}}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
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.
panel_tokenHeaderStringYesA valid panel token.

Response

The response contains an array of connection objects.

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

[
{
"id": 1,
"name": "Test Connection 1",
"type": "usb",
"connected": true,
"port": 1
},
{
"id": 2,
"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"
}
]

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://panel-{{panel_id}}.pdk.io/api/connections/{{connection_id}}/configure HTTP/1.1
Authorization: Bearer {{panel_token}}
Content-Type: application/json

{
"dhcp": false,
"netmask": "255.255.255.0",
"gateway": "10.0.0.1",
"dns": "8.8.8.8"
}
ParameterLocationTypeRequiredDescription
panel_idPathStringYesThe cloud node serial number.
connection_idPathIntegerYesThe connection ID.
panel_tokenHeaderStringYesA valid panel token.
dhcpBodyBooleanYesWhether DHCP should be enabled.
netmaskBodyStringNoThe subnet mask.
gatewayBodyStringNoThe gateway IP address.
dnsBodyStringNoThe DNS IP address.

Response

HTTP/1.1 204 No Content