Campfire API

Streaming

The Streaming API allows you to monitor a room in real time. The authenticated user must already have joined the room in order to use this API.

Connections

Our servers will try to hold the streaming connections open indefinitely. However, API clients must be able to handle occasional timeouts or disruptions. Upon unexpected disconnection, API clients should wait for a few seconds before trying to reconnect.

Formats

The data stream is available in JSON or XML format. JSON is recommended.

Examples

Try one of our example scripts that use the twitter-stream library or YAJL Ruby C bindings.

twitter-stream example | yajl-ruby example

API

GET https://streaming.campfirenow.com/room/#{id}/live.json

Stream a single room’s messages. The target host is always streaming.campfirenow.com.

Response

Status: 200 OK

{"room_id":1,"created_at":"2009-12-01 23:44:40","body":"hello","id":1,
 "user_id":1,"type":"TextMessage","starred":"true"}
{"room_id":1,"created_at":"2009-12-01 23:40:00","body":null,"id":2,
 "user_id":null,"type":"TimestampMessage","starred":"false"}
...