Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

1.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 session 2 https://htekdesk.atlassian.net/wiki/spaces/PHONES/pages/416448516/Htek+XML+API+for+RPS#2.-redirect.registerDevice-%5BinlineExtension%5D

2 redirect.registerDevice

below.

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

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

  • No labels