Skip to main content
Version: 2.2.0

Device Configuration APIs (2.1.0)

Download OpenAPI specification:Download

Device Configuration APIs

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

general

Get device general configuration.

Get device general configuration.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update device general configuration.

Update device general configuration.

Authorizations:
Request Body schema: application/json
description
string <= 512

This is My Thingspro Edge.

hostName
string [ 1 .. 64 ] ^[a-zA-Z]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-...

device hostname.
- Hostname must be between 1 and 64 octets inclusive.
- Each label in the hostname (component separated by ".") must be between 1 and 63 octets inclusive.
- Each label must start with an ASCII alphabet character (a-z, A-Z), end with an ASCII alphanumeric character (a-z, A-Z, 0-9), and must contain only ASCII alphanumeric characters or hyphens (a-z, A-Z, 0-9, "-").

Responses

Request samples

Content type
application/json
Example
{
  • "description": "This is My Thingspro Edge."
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

time

Get device time configuration.

Get device time configuration.

Authorizations:

Responses

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

Update device time configuration.

Update device time configuration.

Authorizations:
Request Body schema: application/json
time
string [ 20 .. 35 ] characters

Current system time (format: RFC3339).

timezone
string [ 1 .. 64 ] characters

device timezone.

object

Responses

Request samples

Content type
application/json
Example
{
  • "time": "2015-03-26T16:27:48+08:00"
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

zoneinfo

Get current timezone information

Get current timezone information

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

dns

Get device's current DNS settings.

Get device's current DNS settings.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

route

Get device route configuration.

Get device route configuration.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update device route configuration.

Update device route configuration.

Authorizations:
Request Body schema: application/json
priorityList
Array of strings[ items [ 2 .. 15 ] characters [A-Za-z0-9_-]+ ]

Responses

Request samples

Content type
application/json
{
  • "priorityList": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

network

Get device route configuration of wan.

Get device route configuration of wan.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

ethernets

Get ethernet interfaces configuration.

Get ethernet interfaces configuration.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 1
}

Get ethernet interface configuration.

Get ethernet interface configuration.

Authorizations:
path Parameters
id
required
integer
Example: 1

Ethernet interface id.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update ethernet interface configuration.

Update ethernet interface configuration.

Authorizations:
path Parameters
id
required
integer
Example: 1

Ethernet interface id.

Request Body schema: application/json
One of
id
integer >= 1

Identifier of an Ethernet interface.

enable
required
boolean

Set interface UP.

enableDhcp
required
boolean

Enable (true) the dhcp client.

wan
required
boolean

Define the interface type is WAN (true) or LAN (false)

Responses

Request samples

Content type
application/json
Example
{
  • "enable": true,
  • "enableDhcp": true,
  • "wan": true
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

serials

Get serial interfaces configuration.

Get serial interfaces configuration.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 2
}

Update serial interfaces configuration.

Update serial interfaces configuration.

Authorizations:
Request Body schema: application/json
Array
id
integer

Interface id.

mode
string
Enum: "rs232" "rs422" "rs4852w" "rs4854w"

Serial interface mode.

baudRate
integer

baud rate

parity
string

parity

dataBits
integer

data bits

stopBits
number

stop bits

flowControl
string

flow control

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 2
}

Get serial interface configuration.

Get serial interface configuration.

Authorizations:
path Parameters
id
required
integer
Example: 1

Serial interface id.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update serial interface configuration.

Update serial interface configuration.

Authorizations:
path Parameters
id
required
integer
Example: 1

Serial interface id.

Request Body schema: application/json
id
integer

Interface id.

mode
string
Enum: "rs232" "rs422" "rs4852w" "rs4854w"

Serial interface mode.

baudRate
integer

baud rate

parity
string

parity

dataBits
integer

data bits

stopBits
number

stop bits

flowControl
string

flow control

Responses

Request samples

Content type
application/json
{
  • "mode": "rs422",
  • "flowControl": "software"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

cellulars

Get cellular interfaces configuration.

Get cellular interfaces configuration.

Authorizations:

Responses

Response samples

Content type
application/json
Example
{
  • "count": 1,
  • "data": [
    ]
}

Update cellular interfaces configuration.

Update cellular interfaces configuration.

Authorizations:
Request Body schema: application/json
Array
id
integer

Interface id.

enable
required
boolean

Enable Cellular Networking.

autoDetect
boolean

Auto detect SIM slot, carrier and APN to create profiles

profileTimeout
integer [ 60 .. 3600 ]

Retry timeout in seconds for switch profiles.

Array of objects (Cellular Profile) [ items ]

Profiles for redundancy

object (Keepalive Settings)

Responses

Request samples

Content type
application/json
Example
[
  • {
    }
]

Response samples

Content type
application/json
Example
{
  • "count": 1,
  • "data": [
    ]
}

Get cellular interface configuration.

Get cellular interface configuration.

Authorizations:
path Parameters
id
required
integer

Cellular interface id.

Responses

Response samples

Content type
application/json
Example
{
  • "currentProfileId": 1,
  • "carrier": "ATT",
  • "ip": "",
  • "tac": "",
  • "type": "cellular",
  • "operatorName": "",
  • "keepalive": {
    },
  • "capabilities": {
    },
  • "id": 1,
  • "gateway": "",
  • "autoDetect": false,
  • "profileTimeout": 120,
  • "esn": "80AF33D7",
  • "imsi": "466977300046885",
  • "status": "ready",
  • "enable": false,
  • "available": true,
  • "dns": [ ],
  • "bid": "",
  • "nid": "",
  • "lac": "11114",
  • "mac": "00:00:11:12:13:14",
  • "imei": "359841080332053",
  • "cellId": "6326",
  • "name": "wwan0",
  • "displayName": "wwan0",
  • "signal": {
    },
  • "pinRetryRemain": -1,
  • "netmask": "",
  • "profiles": [
    ],
  • "mode": "lte",
  • "iccId": "89886971410730170000"
}

Update cellular configuration.

Update cellular configuration.

Authorizations:
path Parameters
id
required
integer

Cellular interface id.

Request Body schema: application/json
enable
required
boolean

Enable Cellular Networking.

autoDetect
boolean

Auto detect SIM slot, carrier and APN to create profiles

profileTimeout
integer [ 60 .. 3600 ]

Retry timeout in seconds for switch profiles.

Array of objects (Cellular Profile) [ items ]

Profiles for redundancy

object (Keepalive Settings)

Responses

Request samples

Content type
application/json
Example
{
  • "enable": true,
  • "keepalive": {
    },
  • "autoDetect": false,
  • "profileTimeout": 120,
  • "profiles": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "currentProfileId": 1,
  • "carrier": "ATT",
  • "ip": "",
  • "tac": "",
  • "type": "cellular",
  • "operatorName": "",
  • "keepalive": {
    },
  • "capabilities": {
    },
  • "id": 1,
  • "gateway": "",
  • "autoDetect": false,
  • "profileTimeout": 120,
  • "esn": "80AF33D7",
  • "imsi": "466977300046885",
  • "status": "ready",
  • "enable": false,
  • "available": true,
  • "dns": [ ],
  • "bid": "",
  • "nid": "",
  • "lac": "11114",
  • "mac": "00:00:11:12:13:14",
  • "imei": "359841080332053",
  • "cellId": "6326",
  • "name": "wwan0",
  • "displayName": "wwan0",
  • "signal": {
    },
  • "pinRetryRemain": -1,
  • "netmask": "",
  • "profiles": [
    ],
  • "mode": "lte",
  • "iccId": "89886971410730170000"
}

gps

Get gps configuration.

Get gps configuration.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch gps configuration.

Patch gps configuration.

Authorizations:
Request Body schema: application/json
mode
required
string
object (GpsLocation)

Location information, with latitude and longitude data.

Responses

Request samples

Content type
application/json
Example
{
  • "mode": "manual",
  • "location": {
    }
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

dhcpservers

Get all DHCP Server configuration

Get all DHCP Server configuration

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 2
}

Patch DHCP Server configuration

Patch DHCP Server configuration

Authorizations:
Request Body schema: application/json
Array
id
required
integer >= 1

Identifier of a DHCP Server

enable
boolean

Enable (true) or disable (false) DHCP Server

startIp
string^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\...

Range IP start

endIp
string^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\...

Range IP end

netmask
string^(?:(?:254|252|248|240|224|192|128)\.0\.0\.0|...

Netmask of DHCP Server

domainNameServers
Array of strings

Domain name servers

domainName
string [ 2 .. 253 ] characters (?=^.{2,253}$)(?:^(?!\.|-)[a-zA-Z0-9\-]{0,62}...

Domain name, empty is allowed

leaseTime
integer [ 60 .. 2592000 ]

Lease time of DHCP pool

Responses

Request samples

Content type
application/json
Example
[
  • {
    }
]

Response samples

Content type
application/json
Example
{
  • "data": [
    ],
  • "count": 1
}

Get DHCP Server configuration

Get DHCP Server configuration

Authorizations:
path Parameters
id
required
integer

DHCP Server ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch DHCP Server configuration

Patch DHCP Server configuration

Authorizations:
path Parameters
id
required
integer

DHCP Server ID

Request Body schema: application/json
id
required
integer >= 1

Identifier of a DHCP Server

enable
boolean

Enable (true) or disable (false) DHCP Server

startIp
string^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\...

Range IP start

endIp
string^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\...

Range IP end

netmask
string^(?:(?:254|252|248|240|224|192|128)\.0\.0\.0|...

Netmask of DHCP Server

domainNameServers
Array of strings

Domain name servers

domainName
string [ 2 .. 253 ] characters (?=^.{2,253}$)(?:^(?!\.|-)[a-zA-Z0-9\-]{0,62}...

Domain name, empty is allowed

leaseTime
integer [ 60 .. 2592000 ]

Lease time of DHCP pool

Responses

Request samples

Content type
application/json
Example
{
  • "id": 1,
  • "enable": true,
  • "startIp": "192.168.3.100",
  • "endIp": "192.168.3.200",
  • "netmask": "255.255.255.0",
  • "domainNameServers": [
    ],
  • "domainName": "example.com",
  • "leaseTime": 2592000
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

wifi

Get Wi-Fi interfaces configuration.

Get Wi-Fi interfaces configuration.

Authorizations:

Responses

Response samples

Content type
application/json
Example
{
  • "data": [
    ],
  • "count": 1
}

Update Wi-Fi interface configuration.

Update Wi-Fi interface configuration.

Authorizations:
Request Body schema: application/json
Array of objects[ items ]
count
integer

Array length.

Responses

Request samples

Content type
application/json
Example
[
  • {
    }
]

Response samples

Content type
application/json
Example
{
  • "data": [
    ],
  • "count": 1
}

Get Wi-Fi interface configuration.

Get Wi-Fi interface configuration.

Authorizations:
path Parameters
id
required
integer

Interface id.

Responses

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

Update Wi-Fi interface configuration.

Update Wi-Fi interface configuration.

Authorizations:
path Parameters
id
required
integer

Interface id.

Request Body schema: application/json
object (Wifi Information)
id
integer

Interface id

mode
required
string

Given Wi-Fi interface mode. Could be one of "ap", "client"

enable
required
boolean

Enable Wi-Fi Networking.

status
boolean

Wi-Fi connection status.

object

Configuration of Wi-Fi AP mode.

object

Configuration of Wi-Fi Client mode.

Responses

Request samples

Content type
application/json
Example
{
  • "type": "wifi",
  • "id": 1,
  • "name": "wlan0",
  • "displayName": "Wi-Fi1",
  • "mode": "ap",
  • "enable": true,
  • "ap": {
    }
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

Get Wi-Fi client networks list

Get Wi-Fi client networks list

Authorizations:
path Parameters
id
required
integer

Interface id.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Post a new Wi-Fi client network to list

Post a new Wi-Fi client network to list

Authorizations:
path Parameters
id
required
integer

Interface id.

Request Body schema: application/json
ssid
required
string

Wi-Fi client network SSID

password
required
string

Wi-Fi client network password

Responses

Request samples

Content type
application/json
{
  • "ssid": "moxa-ap-2",
  • "password": "!2345678"
}

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Update Wi-Fi client network password

Update Wi-Fi client network password

Authorizations:
path Parameters
id
required
integer

Interface id.

uuid
required
string

uuid of Wifi client network

Request Body schema: application/json
ssid
required
string

Wi-Fi client network SSID

password
required
string

Wi-Fi client network password

Responses

Request samples

Content type
application/json
{
  • "password": "*7654321"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete Wi-Fi client network

Delete Wi-Fi client network

Authorizations:
path Parameters
id
required
integer

Interface id.

uuid
required
string

uuid of Wifi client network

Responses

Get Wi-Fi client networks scan results

Get Wi-Fi client networks scan results

Authorizations:
path Parameters
id
required
integer

Interface id.

query Parameters
event
boolean

Get runtime scan, ex: {[{ssid: moxa-test-ap-1, security:{mode: wpa2-personal, encryption: aes, support: true}, signal: -17, band: band50},{...}]}

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

firewall

Get device firewall of port forwarding configurati

Get device firewall of port forwarding configuration

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 2
}

Post device firewall of port forwarding configurat

Post device firewall of port forwarding configuration

Authorizations:
query Parameters
unlock
boolean
Default: false
Examples:
  • unlock=true -
  • unlock=false -
Request Body schema: application/json
id
integer

Port mapping rule id.

enable
boolean
Default: false

Port mapping rule enable/disable.

lock
boolean
Default: false

Lock the rule, not to be DELETE or PATCH directly, need with unlock=true at query string when DELETE or PATCH.

priority
integer

Rule priority. It's an optional parameter, system will arrange a lowest priority(10) if property doesn't exist in payload. 1-5 are system reserved priority rule, need with unlock=true at query string when POST or DELETE or PATCH.

protocol
required
string
Enum: "tcp" "udp" "both"

Rule handles the specified protcol.

externalPort
required
string

Forward destination port number. Support:

  • 502
  • 502-504
internalIp
required
string

Forward source IP address. Support:

  • 192.168.0.1
internalPort
required
string

Forward source port number. Support:

  • 502
  • 502-504

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 2
}

Patch device firewall of port forwarding configura

Patch device firewall of port forwarding configuration

Authorizations:
query Parameters
unlock
boolean
Default: false
Examples:
  • unlock=true -
  • unlock=false -
Request Body schema: application/json
Array
id
integer

Port mapping rule id.

enable
boolean
Default: false

Port mapping rule enable/disable.

lock
boolean
Default: false

Lock the rule, not to be DELETE or PATCH directly, need with unlock=true at query string when DELETE or PATCH.

priority
integer

Rule priority. It's an optional parameter, system will arrange a lowest priority(10) if property doesn't exist in payload. 1-5 are system reserved priority rule, need with unlock=true at query string when POST or DELETE or PATCH.

protocol
required
string
Enum: "tcp" "udp" "both"

Rule handles the specified protcol.

externalPort
required
string

Forward destination port number. Support:

  • 502
  • 502-504
internalIp
required
string

Forward source IP address. Support:

  • 192.168.0.1
internalPort
required
string

Forward source port number. Support:

  • 502
  • 502-504

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 1
}

Delete device firewall of port forwarding configur

Delete device firewall of port forwarding configuration

Authorizations:
query Parameters
unlock
boolean
Default: false
Examples:
  • unlock=true -
  • unlock=false -

Enable to delete locked rule.

flush
boolean
Default: false
Examples:
  • flush=true -
  • flush=false -

Flush all port forwarding rules or not. To delete locked rule, need with unlock=true in query string.

Request Body schema: application/json
Array
integer

Responses

Request samples

Content type
application/json
Example
[
  • 1
]

Response samples

Content type
application/json
Example
{
  • "data": [
    ]
}

Get device firewall of port forwarding configurati

Get device firewall of port forwarding configuration

Authorizations:
path Parameters
id
required
integer
Examples:
  • 1 -

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Patch device firewall of port forwarding configura

Patch device firewall of port forwarding configuration

Authorizations:
path Parameters
id
required
integer
Examples:
  • 1 -
query Parameters
unlock
boolean
Default: false
Examples:
  • unlock=true -
  • unlock=false -
Request Body schema: application/json
id
integer

Port mapping rule id.

enable
boolean
Default: false

Port mapping rule enable/disable.

lock
boolean
Default: false

Lock the rule, not to be DELETE or PATCH directly, need with unlock=true at query string when DELETE or PATCH.

priority
integer

Rule priority. It's an optional parameter, system will arrange a lowest priority(10) if property doesn't exist in payload. 1-5 are system reserved priority rule, need with unlock=true at query string when POST or DELETE or PATCH.

protocol
required
string
Enum: "tcp" "udp" "both"

Rule handles the specified protcol.

externalPort
required
string

Forward destination port number. Support:

  • 502
  • 502-504
internalIp
required
string

Forward source IP address. Support:

  • 192.168.0.1
internalPort
required
string

Forward source port number. Support:

  • 502
  • 502-504

Responses

Request samples

Content type
application/json
{
  • "protocol": "tcp",
  • "externalPort": "10502",
  • "internalIp": "192.168.3.100",
  • "internalPort": "502"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete device firewall of port forwarding configur

Delete device firewall of port forwarding configuration

Authorizations:
path Parameters
id
required
integer
Examples:
  • 1 -
query Parameters
unlock
boolean
Default: false
Examples:
  • unlock=true -
  • unlock=false -

Responses

systemtags

Get data of system status tags.

Get data of system status tags.

Authorizations:
query Parameters
streamInterval
required
integer
Example: streamInterval=1000

stream interval with msec

tags
required
Array of strings
Items Enum: "cpuUser" "cpuSystem" "cpuIdle" "cpuNice" "cpuIowait" "cpuIrq" "cpuSoftirq" "cpuSteal" "cpuUsage" "memoryTotal" "memoryUsed" "memoryFree" "memoryShared" "memoryBuffers" "memoryCached" "memoryUsage" "gpsSignal" "cellular1Signal"
Examples:
  • tags=cpuUsage,memoryTotal,memoryUsage - example of multiple tags

tag name(s). for cellular signal, it could be cellular1Signal for cellular module 1, cellular2Signal for cellular module 2.

Responses

Response samples

Content type
text/event-stream
[
  {
    "prvdName": "system",
    "srcName": "status",
    "tagName": "cpuUsage",
    "ts": 1590135215774,
    "dataType": "int64",
    "dataValue": 44
  },
  {
    "prvdName": "system",
    "srcName": "status",
    "tagName": "memoryTotal",
    "ts": 1590135211806,
    "dataType": "uint64",
    "dataValue": 2116034560
  },
  {
    "prvdName": "system",
    "srcName": "status",
    "tagName": "memoryUsage",
    "ts": 1590135214896,
    "dataType": "uint64",
    "dataValue": 26
  }
]

Get data of system storage tags.

Get data of system storage tags.

Authorizations:
query Parameters
streamInterval
required
integer
Example: streamInterval=1000

stream interval with msec

tags
required
Array of strings
Items Enum: "systemDiskUsed" "systemDiskFree" "systemDiskPercent" "sd1-1DiskUsed" "sd1-1DiskFree" "sd1-1DiskPercent"
Examples:
  • tags=systemDiskPercent,sd1-1DiskPercent - example of multiple tags

tag name(s). for SD card inserted and enabled, sd1-1DiskUsed, sd1-1DiskFree, sd1-1DiskPercent will be available.

Responses

Response samples

Content type
text/event-stream
[
  {
    "prvdName": "system",
    "srcName": "storage",
    "tagName": "systemDiskPercent",
    "ts": 1590135558356,
    "dataType": "double",
    "dataValue": 26.705404330196146
  },
  {
    "prvdName": "system",
    "srcName": "storage",
    "tagName": "sd1-1DiskPercent",
    "ts": 1590135558363,
    "dataType": "double",
    "dataValue": 10.081168276727597
  }
]

Get data of system network usage tags.

Get data of system network usage tags.

Authorizations:
query Parameters
streamInterval
required
integer
Example: streamInterval=1000

stream interval with msec

tags
required
Array of strings
Items Enum: "networkUsage" "networkTx" "networkRx" "cellular1NetworkUsage" "cellular1NetworkTx" "cellular1NetworkRx" "lan1NetworkUsage" "lan1NetworkTx" "lan1NetworkRx"
Examples:
  • tags=networkUsage,networkTx,networkRx - example of multiple tags

tag name(s). for WAN interface use networkUsage, networkTx, networkRx. for cellular module inserted and enabled, cellular1NetworkUsage, cellular1NetworkTx, cellular1NetworkRx will be available.

Responses

Response samples

Content type
text/event-stream
[
  {
    "prvdName": "system",
    "srcName": "network",
    "tagName": "networkUsage",
    "ts": 1590135784561,
    "dataType": "uint64",
    "dataValue": 64842809
  },
  {
    "prvdName": "system",
    "srcName": "network",
    "tagName": "networkTx",
    "ts": 1590135784567,
    "dataType": "uint64",
    "dataValue": 4107946
  },
  {
    "prvdName": "system",
    "srcName": "network",
    "tagName": "networkRx",
    "ts": 1590135784573,
    "dataType": "uint64",
    "dataValue": 60734927
  }
]

platform

Get tag list of device app

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}