slide1

Supported Solutions

Client success is our goal. Our Support Team delivers top-notch turnaround on support requests from any WebPal Server admin. Our enterprise clients enjoy end-user support services to achieve highest levels of adoption and workforce satisfaction.

WebPal Content Server API

Introduction

Use the tabs below to further understand the restful web service supplied with the WebPal Cloud Content Management Server.  Check back frequently as we are always adding to our library.

The Web Service is available at  

http://<path to document manager>/webservice/xml-service.php  

The input to all methods is XML text provided to the service in the body of an HTTP POST. The output is “text/xml” except for file downloads which returns the contents of a file with the appropriate mime type.

The input parameters can be passed either as attribute values of the root element, or as text or CDATA sections within elements whose tags are the parameter names. An example with all parameters as attributes is

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <request command="move" path="/dir/test1/file1" dir="/dir/testb1/testc1" sessionID="bd7d8af5ab41407dac6666874c74c3ab"/>

An example in which some parameters are provided in elements is:

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <request command="upload" 
  3. sessionID="bd7d8af5ab41407dac6666874c74c3ab">
  4. <dir><![CDATA[/dir/test1]]></dir>
  5. <name><![CDATA[file1afddf]]></name>
  6. <title><![CDATA[a document title]]></title>
  7. <content><![CDATA[some text]]></content>
  8. </request>

In the latter example, the command and session id are passed as attributes in the “request” element whereas the “dir”, “title”, and “content” are passed inside elements.

The API method is always identified by the value of the parameter called “command”.

An example of the response XML is

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="ok">
  3. <result>
  4. <path>/dir/test1/file1afddf</path>
  5. </result>
  6. </response>

The root element is tagged with “response”. The status attribute will be “ok” on success, “fail” if an error occurs. The return values are enclosed in the element tagged with “result”.

The root element is tagged with “response”. The status attribute will be “ok” on success, “fail” if an error occurs. The return values are enclosed in the element tagged with “result”.

If an error occurs, the error message will be in an “error” element in the response, for example:

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="fail">
  3. <error>Bad path /dir/testb1</error>
  4. </response>

In order to provide secure access, a client must first log into the web service. This is currently done through the “login” method, which takes a username and password as parameters. The method returns a session id which must be passed in as an argument to all subsequent calls.  

The document manager internal unique id for a document is called a path. This looks like a Unix file system path, but is relative to the root of the document manager repository.

All methods except login require a “sessionID” parameter. This will not be mentioned further in the following.

Many of the document manager commands return a list of zero or more paths. This is encoded in the XML as zero or more “path” elements contained within the result.

The methods provided are

login

The parameters are user and password. The result is identified by an element tagged with “sessionID”. For example,

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="ok">
  3. <sessionID>bd7d8af5ab41407dac6666874c74c3ab</sessionID>
  4. </response>

logout

If a session id is supplied, will end that session. This does nothing otherwise.

recentlyAdded

This has no parameters. Returns the list of recently added files ordered from most recent to oldest. For example,  

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="ok">
  3. <result>
  4. <path>/root/dir1/A Fourth New Folder/abcd/new folder 126685 6972/file1266856971.txt</path>
  5. <path>/root/Interested/Test712/dddddd/20080522_BK_weekly_status_report.doc</path>
  6. <path>/root/garden1.jpg</path>
  7. <path>/root/Policy Docs/2008/March/dir2/NewName/02-08-2010 07;05;05AM.jpg</path>
  8. <path>/root/Projects_DEF/Folder/ffff/aaaa/pike_2007.pdf</path>
  9. </result>
  10. </response>

search

Search returns a list of paths in a directory matching the search criteria. The directory is identified by the “path” parameter, the search criteria as “pattern”. The search that is done is a full text search on the titles and comments of the files and directory in the folder, and a search for files with names containing the search criterion. The full text search splits the criterion into words and ranks the results according to the number of words matched.

listRoots

Returns a list of paths identify the root folders for the logged in user.

listDirectory

Returns a list of paths representing the files in the folder identified by the “path” parameter.

fileCount

Returns the number of non-directory files in the identified by the “path” parameter and all of its descendants.

metaData

Returns the meta data of the file identified by “path”. For example,

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="ok">
  3. <result>
  4. <title>Workflow Editing in YAWL</title>
  5. <comments/>
  6. <draft/>
  7. <review/>
  8. <permissions>admin</permissions>
  9. <user>bryan</user>
  10. <modified>2010/02/23 13:56</modified>
  11. <isdirectory>No</isdirectory>
  12. <size>9</size>
  13. </result>
  14. </response>

setMetaData

This is used to set the meta data properties of “path”. The properties that can be set are “title”, “comments”, “draft”, and “review”. The values of “draft” and “review” must be either “Yes” or “No”.

copy

Copy the file or directory (and all of its contents) to the directory identified by the parameter “dir”.

move  

Move the file or directory (and all of its contents) to the directory identified by the parameter “dir”.

delete  

Delete the file or directory and all of its contents.

rename

Rename a file or directory to the value given by the parameter “name”.

exists

Tests if the path refers to an existing file. The result, “yes” or “no” is returned as the value of the “exists” attribute in the “result” element. For example

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="ok">
  3. <result exists="no"/>
  4. </response>

upload

Uploads data to the directory identified by the “dir” parameter. Other parameters are “name” – the name of the file, “title” – the title to be stored in the meta data, and “content” – the content of the file. The result contains a single path identifying the new file.

createFolder

Creates a folder. Parameters are “dir” – the directory in which to create the folder, and “name” – the name of the new folder.

permissions

Returns the permissions of a file. Parameters are “path” identifying the file. The result is returned in the “permissions” attribute of the “result” element:

 
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <response status="ok">
  3. <result permissions="admin" path="/evangelos"/>
  4. </response>

download

Downloads the contents of the file identified by the “path” parameter. The response is not an XML response – rather the mime type of the return payload is the type appropriate for the file being downloaded.