fhd edited this page Aug 17, 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" channels="users">
        Hello, Germany!
    </message>
    <message id="2" author="thomas" timestamp="1316878550804" channels="users">
        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" channels="users">
    Hello, World!
</message>

Send message

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

Response:

HTTP/1.1 200 OK
Content-Length: ???
Content-type: text/plain
Date: ???
 
http://flurfunk.example.com/message/:id
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.