Body font Header font  
Print

Helipad XML API documentation

Overview

The Helipad API is XML over HTTP. Simply set the following headers to inform Helipad you want to use XML:

Accept: application/xml
Content-Type: application/xml

http://pad.helicoid.net

Methods

Authenticate

Your application could use this to check the authentication details are correct:

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
"http://pad.helicoid.net/authenticate?email=alex@example.com&password=test" 

Get all documents

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
</request>' \
http://pad.helicoid.net/documents

Get a list of document titles

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
</request>' \
http://pad.helicoid.net/documents/titles

Get one document

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
</request>' \
http://pad.helicoid.net/document/1/get

Get the document’s html

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
</request>' \
http://pad.helicoid.net/document/1/format/html

Search for a document

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
  <search>test</search>
</request>' \
http://pad.helicoid.net/document/search

Show documents tagged with

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
</request>' \
http://pad.helicoid.net/document/tag/test

Response: A set of documents with the root tag of ‘documents’.

Defining tags in XML

Tags can be specified as either a structured list:

<tags>
  <tag>
    <name>test</name>
  </tag>
  <tag>
    <name>helipad</name>
  </tag>
</tags>

Or as a space separated list:

<tags>test helipad</tags>

Update document

You can omit fields if you want to keep them the same.

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
  <document>
      <title>Test document</title>
      <source>This is a test</source>
      <tags>
        <tag>
          <name>test</name>
        </tag>
        <tag>
          <name>helipad</name>
        </tag>
      </tags>
  </document>
</request>' \
http://pad.helicoid.net/document/1/update

Response:

<saved>true</saved>

Create document

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
  <document>
      <title>New document</title>
      <source>This is a test</source>
      <tags>
        <tag>
          <name>test</name>
        </tag>
        <tag>
          <name>helipad</name>
        </tag>
      </tags>
  </document>
</request>' \
http://pad.helicoid.net/document/create

Response:

<saved>true</saved>

Destroy document

curl  -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '
<request>
  <authentication>
    <email>alex@example.com</email>
    <password>test</password>
  </authentication>
</request>' \
http://pad.helicoid.net/document/2/destroy

Response:

<deleted>true</deleted>