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

Version 1 Next »

Connecting to the API

These are the steps to use the API:

  1. Connect to the API
  2. Create a new session for a user
  3. Call the desired methods, passing the session ID as argument
  4. Close the session

Connection example

The TermWeb API is configured at the URI /termweb/api by default, so if your TermWeb is installed at http://myserver.example.com/termweb the API is found at http://myserver.example.com/termweb/api.

The TermWeb API uses the prefix termwebapi2 for all methods.

The API URI can be modified in the web.xml file. See XML-RPC overview.

Example code

Connect to the TermWeb server:

connect('http://myserver.example.com/termweb/api');

Create a new session for guest user:

<?xml version="1.0"?>
<methodCall>
   <methodName>termwebapi2.initSession</methodName>
   <params>
   </params>
</methodCall>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param><value>123456789abc</value></param>
  </params>
</methodResponse>

Close the session:

<?xml version="1.0"?>
<methodCall>
   <methodName>termwebapi2.close</methodName>
   <params>
     <param><value><string>123456789abc</string></value></param>
   </params>
</methodCall>                                                                                                                                                                                                                                                                                                                                                

Response:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param><value>0</value></param>
  </params>
</methodResponse>
  • No labels