Fietstas REST web service reference

Fietstas is a text analysis system that provides a set of web services for processing textual content of your documents. Here are a few things you can do with Fietstas:

Fietstas performs most of the necessary document processing in the background and uses caching to minimize waiting time for your requests.

Service overview

Fietstas consists of several related web services:

Key Service

To be able to use all the other services of Fietstas, a user first needs to obtain a unique API key. The key service deals with the generation and validation of API keys. There are only two methods: to generate a new key and to validate an existing key.

Requesting a new API key

Response in case of success:

HTTP 201 Created
<?xml version="1.0" encoding="utf-8"?>
<user>
        <name>Your name</name>
        <key>Your new API key</key>
        <created>Key creation time</created>
        <updated>Key update time</updated>
        <access_count>Number of times the key has been used</access_count>
        <access_limit>Maximum allowed number of key uses per day</access_limit>
</user>

Responses in case of failure:

Validating an existing API key

Response in case of success:

HTTP 200 OK
<?xml version="1.0" encoding="utf-8"?>
<user>
        <name>Your name</name>
        <key>Your API key</key>
        <created>Key creation time</created>
        <updated>Key last usage time</updated>
        <access_count>Number of times the key has been used</access_count>
        <access_limit>Maximum allowed number of key uses per day</access_limit>
</user>

Responses in case of failure:

Document Service

Before you can use documents in a term cloud or ask Fietstas to annotate them, you need to upload the documents to Fietstas. On upload, the document service stores documents, prepares them for processing (if requested by the user), and schedules the appropriate processing jobs. The document service contains methods to upload and to query documents.

Uploading a document

Notes:

Response in case of success:

HTTP 202 Accepted
<?xml version="1.0" encoding="utf8"?>
<docs xmlns="http://ilps.science.uva.nl/fietstas/doc">
 <doc id="New document id"/>
</docs>

Responses if failure:

Listing uploaded documents

Response if success:

HTTP 200 OK
<?xml version="1.0" encoding="utf-8"?>
<docs total_count="Total number of matching documents" xmlns="http://fietstas.science.uva.nl/doc">
        <doc id="one document ID"/>
        <doc id="another document ID"/>
        etc...
</docs>

Responses if failure:

Getting a document

Request:

Request parameters:

Response if successful:

HTTP 200 Ok
<?xml version="1.0" encoding="utf8"?>
<docs xmlns="http://ilps.science.uva.nl/fietstas/doc">
 <doc>

  <docid>doc123</docid>
  <text>......</text>
  <meta>
   <tags>
    <tag>testtag</tag>

    <tag>week1</tag>
    <tag>test3</tag>
   </tags>
  </meta>
 </doc>

</docs>

Responses if failure:

Deleting documents

[not implemented]

Location: /doc HTTP method: DELETE Parameters:

Response:

Term annotation service

Requesting an annotation

Location:: /anno HTTP method: POST

Parameters:

Response:

Obtaining a previously requested annotation

Location:: /anno HTTP method: GET

Parameters:

Term cloud Service

The term cloud service deals with the generation of term clouds. Generated term clouds are wrapped in a cloud list so that dynamic tag clouds can also be generated using this service. When a request for a cloud list is submitted, a unique ID is assigned to the request. This request ID can be used later to access the generated cloud(s). The service performs all necessary processing of the documents, even if it was not specified when posting the documents.

Location: /cloud

Generating a simple term cloud

Requests:

Request parameters:

Note:

Example request (with explicit list of documents):

POST /cloud
key=key1234&name=Cloud&description=My+clouds&docs=doc1,doc2

Example request (using a tag to specify a collection of documents):

POST /cloud
key=key1234&name=Cloud&description=My+clouds&tags=tag1

Generating a dynamic tag cloud

Requests:

Request parameters:

Note:

Example request (with explicit list of documents):

POST /cloud
key=key1234&name=Cloud&description=My+clouds&labels=cloud1,cloud2&docs:cloud1=doc1,doc2&docs:cloud2=doc3,doc4&name:cloud2=Example

Example request (using a tag to specify a collection of documents):

POST /cloud
key=key1234&name=Cloud&description=My+clouds&labels=cloud1,cloud2&tags:cloud1=tag1&tags:cloud2=tag2&name:cloud2=vsdfv&description:cloud2=blaat

Responses (in both cases)

Response if valid request, but nothing processed yet:

HTTP 202 Accepted
...
<?xml version="1.0" encoding="utf8"?>
<request xmlns="http://ilps.science.uva.nl/fietstas/request">
 <id>req123</id>
 <status>wait</status>

 <message>5</message>
</request>

Response if valid request and only a partial cloud is available:

HTTP 206 Partial cloud
...
<?xml version="1.0" encoding="utf8"?>
<request xmlns="http://ilps.science.uva.nl/fietstas/request">
 <id>req123</id>

 <status>partial</status>
 <message>30%</message>
 <cloud-list xmlns="http://ilps.science.uva.nl/fietstas/cloud">
  <cloud>
    ...
  </cloud>

 </cloud-list>
</request>

Response if valid request and cloud is ready:

HTTP 200 OK
...
<?xml version="1.0" encoding="utf8"?>
<request xmlns="http://ilps.science.uva.nl/fietstas/request">
 <id>req123</id>

 <status>completed</status>
 <message>100%</message>
 <cloud-list xmlns="http://ilps.science.uva.nl/fietstas/cloud">
  <cloud>
    ...
  </cloud>

 </cloud-list>
</request>

Along with the output, Fietstas also sends several HTTP headers to convey status information about the cloud request. These headers are the following:

If the request failed, the following responses may be given:

For the xml definition of a term cloud, see this page. The contents of the response depend on the value of status. Status can have the following values:

The message field is dependend on the status field as follows:

If the status is either partial or completed, then the cloud-list element is present. Otherwise, it is left out.