Contents
Introduction
The APIdoc XML interface is a REST interface. Requests are made using simple HTTP GET and POST requests. Responses are returned as simple XML documents.
If you do use the XML interface, please use a descriptive User-Agent in the requests. The User-Agent should ideally contain a URL where more information about the client application can be found, or an email address where the author can be contacted.
If you write a client that uses the XML interface and would like a link from APIdoc.org, please contact us.
Authentication
Some requests, such as getuser, require authentication. Others, such as search will work either anonymously or with a login.
The authentication mechanism uses an HTTP cookie (the same mechanism that is used for the remember me facility on the site). The value of this cookie contains an encrypted representation of the user's email address and password.
To get a cookie value from an email address and password, use the
getusercookie request. Once you have the value,
submit it as the value of the login cookie:
GET /xml/getuser HTTP/1.0
Host: apidoc.org
Cookie: value=<urlencodedcookie>
Responses
The responses to all requests are all UTF-8 encoded XML documents with the following form:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>[ok|error]</status>
<!-- Response Content -->
</response>
An error response will have a status of error and an
error element with a message as the content:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>error</status>
<error>
<message>Error message</message>
</error>
</response>
An ok status indicates the request was successful.
Each request defines its own response content.
Requests
All requests are submitted using HTTP GET requests to URLs of the formhttp://apidoc.org/xml/requestname?param1=value1¶m2=value2.
Parameters are submitted in the query string. Parameter values must be URL encoded using
UTF-8.
currenttimestamp
The currenttimestamp request returns the current time on the server. This is useful for making getusercookie requiests.
| Request | currenttimestamp |
|---|---|
| URL | http://apidoc.org/xml/currenttimestamp |
| Authentication | Not required |
| Parameters | None |
| Response Content | <currentTimestamp>Where timestampValue is the number of seconds since midnight GMT on January 1 1970. |
getuser
The getuser request returns details about the authenticated user.
| Request | getuser |
|---|---|
| URL | http://apidoc.org/xml/getuser |
| Authentication | Required |
| Parameters | None |
| Response Content | <user>Where name and emailAddress are the name and email address of the authenticated user. If no login cookie or an invalid login cookie is provided, the error Not logged in will be returned. |
getusercookie
The getuser request returns an authentication cookie for an email address and password.
| Request | getusercookie | ||||||
|---|---|---|---|---|---|---|---|
| URL | http://apidoc.org/xml/getusercookie | ||||||
| Authentication | Not required | ||||||
| Parameters |
|
||||||
| Response Content | <usercookie>Where cookieValue is a cookie value that can be submitted as the value of the login cookie to indicate the authenticated user. If the timestamp is too old or the email address and password are not valid an error will be returned. |
search
The search request performs a search.
| Request | search | ||||||
|---|---|---|---|---|---|---|---|
| URL | http://apidoc.org/xml/search | ||||||
| Authentication | Optional. If authenticated, the user's aliases and groups will be available in the search. Otherwise, only the default aliases and groups can be used. | ||||||
| Parameters |
|
||||||
| Response Content | The response content consists of a search element containing a
results element. The results element contains a number of result elements.
For example:<search> |

