General Purpose

This X-Service is used to retrieve a list of eShelf folders defined for a logged-in user and retrieve information about each eShelf folder.


  • login – Called once by the calling application with valid /X user name and password. The session-id retrieved should be passed to all other API calls
  • Authentication (optional, either local or remote)
    • bor_auth – for local authentication of the user and to retrieve a valid borrower’s ID or bor_info
    • PDS authentication – for remote authentication of the user and to obtain a pds handle
  • bor_info (optional)
  • retrieve_category – optional, retrieves Categories ID, used in conjunction with WFL (see below)
  • retrieve_eshelf_folders

Input Parameters

1. SESSION_ID – X(50)
  • Option 1
    • SOURCE_ID – X(40)
    • INSTITUTE – X(30)
    • VERIFICATION – X(20)
  • Option 2
    • BOR_ID – X(12)
    • VERIFICATION – X(20)
  • Option 3
    • PDS_HANDLE – X(50)
Explanation of the mandatory parameters:
  • session_id – the unique identifier returned by the login request
  • user id – one of the following:
    • source_id – user login name
      institute – institution to which the user is affiliated
      verification – user password
    • bor_id – unique user ID
      verification – user password
    • pds-handle – user’s unique token returned by the remote authentication system

Input XML Format

Logged-in user, local authentication:

<?xml version = "1.0" encoding = "UTF-8"?>

Logged-in user, remote authentication:

<?xml version = "1.0" encoding = "UTF-8"?>

Input URL Syntax

In order to retrieve eShelf folders, the input parameters must be embedded within the appropriate URL syntax:

MetalibPath:port/X?op=retrieve_eshelf_folders_request&bor_id=patron num&verification=***&session_id=session_id

Example URL Syntax

Logged-in user, local authentication:


Logged-in user, remote authentication:


Output XML Format

Information about each eShelf folder:
  • Folder name – Name of the eShelf folder.
  • No documents – Number of results, defined in the eShelf folder.

<x_server_response metalib_version="4.00 (20)">
    <set_name>Computer Science</set_name>
  <session_id new_session="n">32GS85B67MEX93N5PX6AAH8PYEXI1XPNPMQU8SCHJ9QR1R5I5D</session_id>

Possible Error Codes

1. If the session_id, provided as an input parameter, is not valid, the following error message appears in the XML output:

<error_text> You are not authorized to use this function </error_text>

This can be caused by not using the session_id returned from the login X-Service.

2. If this X-Service was activated after the session had timed out:

<error_text>session timeout</error_text>

3. If the user-id cannot be found:

<error_text>User does not exist</error_text>

4. User ID is mandatory:

<error_text>User Id is mandatory</error_text>

5. If the requested user has no eShelf folders:

<error_text>User has no eShelf folders</error_text>

6. If the institution does not exist:

<error_text>Institution does not exist</error_text>

7. If the number of eShelf folders is higher than the limit:

<error_text>The number of eshelf folders is higher than the eShelf limit</error_text>

8. If the PDS handle is invalid, the user will be treated as guest:

<error_text>PDS handle is invalid</error_text>

9. If the format of the pds_handle is incorrect:

<error_text>Invalid pds_handle format</error_text>

10. If the pds_handle is not valid:

<error_text>Invalid pds_handle</error_text>

If 9 or 10 above are returned, the request will not terminate in error. The onus is on the calling application as to how to proceed.


Output XML Formal example is wrong (or valid only for a very old MetaLib version).  The folder_info elements are not set_name and no_bases, instead they are folder_name and no_documents.  Example:

<?xml version="1.0" encoding="UTF-8"?>
<x_server_response metalib_version="4.4.3 (731)">
      <folder_name>Temporary folder</folder_name>
    <session_id new_session="N">UR09VKAUX9EA38CGLYX878R59X1LDJ55XHJ3AZQIEV7RT8YIY8</session_id>