getLibraryInfoByName Interface

The getLibraryInfoByName interface returns the ID, name, and description of all libraries with a specified name. The interface returns only the properties of libraries, not their structure. The following table shows the parameters of the getLibraryInfoByName interface.

Interface URL Parameter Descriptions

http://<front-end URL>/servicesExchange?hid=getLibraryInfoByName

sid Web-service token or session identifier for user authentication. You can generate the web-service token in the Settings Page of the Silk Central UI. To access this page, hover the mouse cursor over the user name in the Silk Central menu and select User Settings. You can retrieve the session identifier by invoking the logonUser method of one of the Available Web Services.
  libraryName The name of the library

Example: http://<front-end URL>/servicesExchange?hid=getLibraryInfoByName&sid=<webServicesToken>&libraryName=<name>

getLibraryInfoByName Web Service Example

The following code uses Apache HttpClient to get library information.

import org.apache.commons.httpclient.*; // Apache HttpClient

String webServiceToken = "e39a0b5b-45db-42db-84b2-b85028d954d5";

URL service = new URL("http", mWebServiceHelper.getHost(),
  mWebServiceHelper.getPort(), String.format("/servicesExchange?hid=%s&sid=%s",
  "getLibraryInfoByName", webServiceToken, LIBRARY_NAME));
	
HttpClient client = new HttpClient();
client.getHttpConnectionManager().getParams().setConnectionTimeout(60000);
HttpMethod fileGet = new GetMethod(service.toExternalForm());
int status = client.executeMethod(fileGet);
System.out.println(fileGet.getStatusLine());
String response = fileGet.getResponseBodyAsString();
System.out.println(response);

To download Apache HttpComponents, visit http://hc.apache.org/downloads.cgi. Refer to the documentation of the component for the required libraries.