Skip to content
fhd edited this page Apr 19, 2012 · 4 revisions

REST API

(Replace flurfunk-url with your own, localhost, port, etc)

Getting lists of messages

Get all messages (this is limited to at most 200 right now):

GET http://flurfunk.example.com/messages

Get all messages since a certain timestamp:

GET http://flurfunk.example.com/messages?since=1316895441665

Get all messages before a certain timestamp:

GET http://flurfunk.example.com/messages?before=1316895441665

Get a specific number of messages:

GET http://flurfunk.example.com/messages?count=20

You can freely combind these parameters.

Response

HTTP/1.1 200 OK
Content-Length: ???
Content-type: text/plain
Date: ???
 
<messages>
    <message id="1" author="felix" timestamp="1316878519856">
        Hello, Germany!
    </message>
    <message id="2" author="thomas" timestamp="1316878550804">
        Hello, Norway!
    </message>
</messages>

Get single messages

Get message by id:

GET http://flurfunk.example.com/message/13

Response

HTTP/1.1 200 OK
Content-Length: ???
Content-type: text/plain
Date: ???
 
<message id="13" author="felix" timestamp="1316878754108">
    Hello, World!
</message>

Send message

POST http://flurfunk.example.com/message
Content-Type: application/xml
 
<message author="felix">
    Hello, World!
</message>

Response:

HTTP/1.1 200 OK
Content-Length: ???
Content-type: text/plain
Date: ???
 
http://flurfunk.example.com/message/:id
Clone this wiki locally