Htek XML API for RPS
- 1 Protocol
- 2 Service Port
- 3 User Accounts
- 4 Available XML-RPC Commands
- 4.1 1. redirect.registerDevice
- 4.2 2. redirect.registerDevice(isoverride)
- 4.3 3 redirect.deRegisterDevice
- 4.4 4 redirect.listDevices
- 4.5 5 redirect.checkDevice
- 4.6 6 redirect.registerDevices
- 4.7 7 redirect.registerDevices(isoverride)
- 4.8 8 redirect.deRegisterDevices
- 4.9 9 redirect.addServer
- 4.10 10 redirect.editDevice
- 4.11 11 redirect.editDevice(isoverride)
Protocol
The API of RPS is built as standard XML-RPC services. Two ways are possible to access the interface:
You can use XML-RPC libraries available on the internet.
You can send XML commands specified further down via HTTP POST using Content-Type:text/xml.
TLS/SSL is used to encrypt the communications between client and server.
User authentication is done via basic authentication using username and password.
Service Port
The XML-RPC RPS service can be accessed at:
https://rps.htek.com/index.php/xmlrpc
User Accounts
In order to access the RPS, you need to have a valid account that you can apply for from
Htek or our local distributors.
Available XML-RPC Commands
1. redirect.registerDevice
You can redirect a specific device to a different configuration server by its MAC ID.
1.1 XML-RPC signature
redirect.registerDevice(mac,serverName)
1.2 Parameter
mac: MAC address you want to register to RPS
serverName: The server name you already added to RPS which the device should be redirected to
Result code: True, False
Result text:
(1) OK: If the MAC address has been registered successfully to a specific server.
(2) Errors:
Invalid MAC(s): mac → Invalid format of MAC address
Existing MAC(s): mac → The MAC address has been registered by yourself.
Error: Invalid server → Invalid server name
Are you sure you want to override MAC addresses: The MAC address has been registered by another RPS user. If you want to override it, please see more details on section 2 - redirect.registerDevice(isoverride).
1.4 Request
<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>redirect.registerDevice</methodName>
<params>
<param>
<value>
<string><![CDATA[001fc1000001]]></string>
</value>
</param>
<param>
<value>
<string><![CDATA[serverName]]></string>
</value>
</param>
</params>
</methodCall>
Notes
”<![CDATA[ ]]>” is not necessary, but with it, you can enter special characters, such as “&,$,#,@,<,>” and so on.
Four types of valid MAC address format are 001fc1000001, 00-1f-c1-00-00-01, 00 1f c1 00 00 01, 00:1f:c1:00:00:00:01.
1.5 Answer
1.5.1 Positive Answer
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions">
<params>
<param>
<value>
<array>
<data>
<value>
<boolean>1</boolean>
</value>
<value>OK</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
1.5.2 Negative Answer
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions">
<params>
<param>
<value>
<array>
<data>
<value>
<boolean>0</boolean>
</value>
<value>Error:Invalid MAC(s):00s1122334400</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
2. redirect.registerDevice(isoverride)
If the MAC address you are registering has been registered by another RPS user, you can confirm whether to override the previous registration by isOverride
parameter.
2.1 XML-RPC signature
redirect.registerDevice(mac,serverName,isOverride)
2.2 Parameter
mac: MAC address you want to register to RPS.
serverName: The server name you already added to RPS which the device should be redirected.
isOverride: Confirm whether to override the previous registration or not.
1: Override confirmation
0: Cancel registration
2.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been registered successfully to a specific server.
(2) Errors:
Invalid MAC(s): mac → Invalid format of MAC address
Existing MAC(s): mac → The MAC address has been registered by yourself.
Error: Invalid server → Invalid server name
Only 0 or 1 can be used:1 to override, 0 to cancel → Invalid isOverride value
MAC address(es) overriding failed → Failed to override the previous MAC address
2.4 Request
2.5 Answer
2.5.1 Positive Answer
2.5.2 Negative Answer
3 redirect.deRegisterDevice
You can remove a specific device from RPS by deregistering its MAC address.
3.1 XML-RPC signature
redirect.deRegisterDevice(mac)
3.2 Parameter
mac: MAC address you would like to remove from RPS
3.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been deregistered successfully.
(2) Error:
Invalid MAC(s): mac → Invalid
3.4 Request
3.5 Answer
3.5.1 Positive Answer
3.5.2 Negative Answer
4 redirect.listDevices
You can list all the devices(MACs) that you have already registered.
4.1 XML-RPC signature
redirect.listDevices()
4.2 Return values
Result code: True, False
Result text:
(1) OK:
(2) Error:
No devices found → No registered devices found
4.3 Request
4.4 Answer
4.4.1 Filled Answer
4.4.2 Empty Answer
5 redirect.checkDevice
You can check if a device(MACs) is registered to RPS.
5.1 XML-RPC signature
redirect.checkDevice(mac)
5.2 Parameter
mac: MAC address you want to check.
5.3 Return values
Result code: True, False
Result text:
(1) OK:
Unregistered → Not assigned to a specific server.
Registered → MAC has been assigned to a specific server.
Registered Elsewhere → MAC has been registered by another RPS user.
Unknown → MAC has not been added to RPS.
(2) Error:
Invalid MAC → Invalid format of MAC address.
5.4 Request
5.5 Answer
5.5.1 Positive Answer
5.5.2 Negative Answer
6 redirect.registerDevices
You can register a list of devices to a different configuration server by MAC IDs.
6.1 XML-RPC signature
redirect.registerDevices(macList,serverName)
6.2 Parameter
mac: MAC address you want to register to RPS.
serverName: The server name you already added to RPS which the device should be redirected.
6.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been registered successfully to a specific server.
(2) Errors:
Invalid MAC(s):mac → Invalid format of MAC address
Existing MAC(s):mac → The MAC address has been registered by yourself.
Error:Invalid server → Invalid server name
Are you sure you want to override MAC addresses → The MAC address has been registered by another RPS user. If you want to override it, please see more details on section 7 - redirect.registerDevices(isoverride).
6.4 Request
6.5 Answer
6.5.1 Positive Answer
6.5.2 Negative Answer
7 redirect.registerDevices(isoverride)
If the MAC addresses you are registering have been registered by other RPS users, you can confirm whether to override the previous registrations by isOverride
parameter.
7.1 XML-RPC signature
redirect.registerDevices(macList,serverName,isOverride)
7.2 Parameter
macList: MAC addresses you want to register to RPS.
serverName: The server name you already added to RPS which the device should be redirected to.
isOverride: Confirm whether to override the previous registration or not.
1: Override confirmation
0: Cancel registration
7.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been registered successfully to a specific server.
(2) Errors:
Invalid MAC(s):mac → Invalid format of MAC address
Existing MAC(s):mac → The MAC address has been registered by yourself.
Error:Invalid server → Invalid server name
Only 0 or 1 can be used:1 to override, 0 to cancel → Invalid isOverride value
MAC address(es) overriding failed → Failed to override the previous MAC address
7.4 Request
7.5 Answer
7.5.1 Positive Answer
7.5.2 Negative Answer
8 redirect.deRegisterDevices
You can remove a list of s devices from RPS by deregistering these MAC addresses.
8.1 XML-RPC signature
redirect.deRegisterDevices(macList)
8.2 Parameter
macList: MAC addresses you would like to remove from RPS
8.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been deregistered successfully.
(2) Error:
Invalid MAC(s):mac → Invalid format of MAC address or the MAC address has not been registered by you.
8.4 Request
8.5 Answer
8.5.1 Positive Answer
8.5.2 Negative Answer
9 redirect.addServer
You can add a different configuration server which is used to redirected devices to.
9.1 XML-RPC signature
redirect.addServer(serverName,serverUrl)
9.2 Parameter
serverName: The server name you already added to RPS which the device will be redirected to.
serverUrl: The specific URL of your configuration server.
9.3 Return values
Result code: True, False
2. Result text:
(1) OK: The server has been added successfully.
(2) Errors:
The url can only begin with 'http://' or 'https://' or 'ftp://' or 'tftp://' → Invalid format of URL
The server name cannot be empty. → The serverName should not be empty.
The server url cannot be empty → The serverUrl should not be empty.
The server name has been used → The serverName has been used.
The server name can only contain 'A-z 0-9 - _ . '(include space) → Invalid format of serverName.
9.4 Request:
9.5 Answer
9.5.1 Positive Answer
9.5.2 Negative Answer
10 redirect.editDevice
You can change the configuration server that the device(s) has registered to another server.
10.1 XML-RPC signature:
redirect.editDevice(mac,serverName)
10.2 Parameter
mac: The MAC address you would like to edit.
serverName: The server name you would like to re-register the MAC to.
10.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been registered successfully to a specific server.
(2) Errors:
Invalid MAC(s):mac → Invalid format of MAC address
Error:Invalid server → Invalid server name
The MAC is unknown → MAC has not been registered
Are you sure you want to override MAC addresses → The MAC address has been registered by another RPS user. If you want to override it, please see more details on section 11 - redirect.editDevice(isoverride).
10.4 Request
10.5 Answer
10.5.1 Positive Answer
10.5.2 Negative Answer
11 redirect.editDevice(isoverride)
If the MAC address you are registering has been registered by another RPS user, you can confirm whether to override the previous registration by isOverride parameter.
11.1 XML-RPC signature
redirect.editDevice(mac,serverName,isOverride)
11.2 Parameter
mac: The MAC address you would like to edit.
serverName: The server name you would like to re-register the MAC.
isOverride: Confirm whether to override the previous registration or not.
1: Override confirmation
0: Cancel registration
11.3 Return values
Result code: True, False
Result text:
(1) OK: If the MAC address has been registered successfully to a specific server.
(2) Errors:
Invalid MAC(s):mac → Invalid format of MAC address
The MAC is unknown → MAC has not been registered
Error:Invalid server → Invalid server name
Only 0 or 1 can be used:1 to override, 0 to cancel → Invalid isOverride value
MAC address(es) overriding failed → Failed to override the previous MAC address
11.4 Request
11.5 Answer
11.5.1 Positive Answer
11.5.2 Negative Answer