Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Basic Networking

URL

http://<<ip address>>/rest/network/ipaddress

Method

GET

Description

Receives information on the current network setup.

Gets a list of currently defined IP addresses

Response

Code Block
languagejson
{
  "ipaddress": [«list of ip addresses»]
}

Status

StatuscolourYellowtitlepending

URL

http://<<ip address>>/rest/network

Method

GET

Description

Receives information on the current network setup.

Response

Code Block
languagejson
{
  "type": "wifi|ethernet",
  "connection": "static|dhcp",
  "static": {
    "ipaddress": «ipaddress»,
    "netmask": «netmask»,
    "gateway": «gateway»
  },
  "wifi": {
    "ssid": «ssid»,
    "key": «pre shared key»
  }
}

URL

http://<<ip address>>/rest/network

Method

PUT

Description

Sets network settings, will reboot afterwards.

Request

Code Block
languagejson
{
  "type": "wifi|ethernet",
  "connection": "static|dhcp",
  "static": {
    "ipaddress": «ipaddress»,
    "netmask": «netmask»,
    "gateway": «gateway»
  },
  "wifi": {
    "ssid": «ssid»,
    "key": «pre shared key»
  }
}

Response

HTTP204 when

succesful

successful, followed by a reboot

Possible Errors

HTTP400 when request was invalid

Code Block
languagejson
{
  "message": «human readable error»
}

HTTPS Support

HTTPS support is available with user-supplied PFX certificates, encrypted with a password. During startup, the PTLControl will decide if it will use HTTPS or not. When any error occurs, it falls back to HTTP. It is up to the client to connect using HTTP or HTTPS. It will also be available on port 5000.

To upload the PFX file and password, the API provides a httpscall. Uploading a new certificate will overwrite an existing one. The PTL Control needs to be restarted for changes to take effect.

URL

http://<<ip address>>/rest/network/https/

Method

POST

Description

Upload a new HTTPS certificate (in .pfx format) and password.

Request

Code Block
{
   "certificate": «base64 encoded PFX file»,
   "password": «plaintext password»
}

Status

StatuscolourYellowtitlepending

Response

HTTP204

Possible Error

When an invalid certificate is uploaded, the system falls back to HTTP.

URL

http://<<ip address>>/rest/network/https/

Method

DELETE

Description

Remove certificate and password

Request

Empty

Response

HTTP204