/
Htek XML API for RPS

Htek XML API for RPS

Protocol

The API of RPS is built as standard XML-RPC services. Two ways are possible to access the interface:

  1. You can use XML-RPC libraries available on the internet.

  2. You can send XML commands specified further down via HTTP POST using Content-Type:text/xml.

  3. TLS/SSL is used to encrypt the communications between client and server.

  4. 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

  1. ”<![CDATA[ ]]>” is not necessary, but with it, you can enter special characters, such as “&,$,#,@,<,>” and so on.

  2. 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

<?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> <param> <value> <string><![CDATA[0]]></string> </value> </param> </params> </methodCall>

2.5 Answer

2.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>

2.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>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>redirect.deRegisterDevice</methodName> <params> <param> <value> <string><![CDATA[001122334401]]></string> </value> </param> </params> </methodCall>

3.5 Answer

3.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>

3.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):001122334401</value> </data> </array> </value> </param> </params> </methodResponse>

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:

<array> <data> <value>MAC1</value> <value>MAC2</value> </data> </array>

(2) Error:

No devices found → No registered devices found

4.3 Request

<?xml version='1.0' encoding='UTF-8'?> <methodCall>     <methodName>redirect.listDevices</methodName> </methodCall>

4.4 Answer

4.4.1 Filled 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>                             <array>                                 <data>                                     <value></value>                                     …                                 </data>                             </array>                         </value>                     </data>                 </array>             </value>         </param>     </params> </methodResponse>

4.4.2 Empty 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>No device(s) exists</value>                     </data>                 </array>             </value>         </param>     </params> </methodResponse>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall>     <methodName>redirect.checkDevice</methodName>     <params>         <param>             <value>                 <string><![CDATA[001fc1000001]]></string>             </value>         </param>     </params> </methodCall>

5.5 Answer

5.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>Registered</value>                     </data>                 </array>             </value>         </param>     </params> </methodResponse>

5.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)</value>                     </data>                 </array>             </value>         </param>     </params> </methodResponse>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>redirect.registerDevices</methodName> <params> <param> <value> <array> <data> <value> <string><![CDATA[001fc1000001]]></string> </value> <value> <string><![CDATA[001fc1000002]]></string> </value> … </data> </array> </value> </param> <param> <value> <string><![CDATA[serverName]]></string> </value> </param> </params> </methodCall>

6.5 Answer

6.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>

6.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>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall>     <methodName>redirect.registerDevices</methodName>     <params>         <param>             <value>                 <array>                     <data>                         <value>                             <string><![CDATA[001fc1000001]]></string>                         </value>                         <value>                             <string><![CDATA[001fc1000002]]></string>                         </value>                     </data>                 </array>             </value>         </param>         <param>             <value>                 <string><![CDATA[serverName]]></string>             </value>         </param>         <param>             <value>                 <string><![CDATA[0/1]]></string>             </value>         </param>     </params> </methodCall>

7.5 Answer

7.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>

7.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>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall>     <methodName>redirect.deRegisterDevices</methodName>     <params>         <param>             <value>                 <array>                     <data>                         <value>                             <string><![CDATA[001fc1000001]]></string>                         </value>                         <value>                             <string><![CDATA[001fc1000002]]></string>                         </value>                         …                     </data>                 </array>             </value>         </param>     </params> </methodCall>

8.5 Answer

8.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>

8.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):001122334401</value>                     </data>                 </array>             </value>         </param>     </params> </methodResponse>

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:

<?xml version='1.0' encoding='UTF-8'?> <methodCall> <methodName>redirect.addServer</methodName> <params> <param> <value> <string><![CDATA[serverName]]></string> </value> </param> <param> <value> <string><![CDATA[serverURL]]></string> </value> </param> </params> </methodCall>

9.5 Answer

9.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>

9.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:The server name has been used </value>                     </data>                 </array>             </value>         </param>     </params> </methodResponse>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall>     <methodName>redirect.editDevice</methodName>     <params>         <param>             <value>                 <string><![CDATA[001fc1000001]]></string>             </value>         </param>         <param>             <value>                 <string><![CDATA[serverName]]></string>             </value>         </param>     </params> </methodCall>

10.5 Answer

10.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>

10.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>

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

<?xml version='1.0' encoding='UTF-8'?> <methodCall>     <methodName>redirect.editDevice</methodName>     <params>         <param>             <value>                 <string><![CDATA[001fc1000001]]></string>             </value>         </param>         <param>             <value>                 <string><![CDATA[serverName]]></string>             </value>         </param>         <param>             <value>                 <string><![CDATA[0]]></string>             </value>         </param>     </params> </methodCall>

11.5 Answer

11.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>

11.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>

 

Related content