Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 94 lines (64 sloc) 2.668 kb
93a063f @qrush first few sections of campfire api
qrush authored
1 Messages
2 ========
3
15b42ba @packagethief Fix links to the full data reference
packagethief authored
4 For the full XML representation of messages, [check out the data reference](https://github.com/37signals/campfire-api/blob/master/sections/data_reference.md#message).
93a063f @qrush first few sections of campfire api
qrush authored
5
6
7 Create message
8 --------------
9
10 * `POST /room/#{id}/speak.xml` sends a new message with the currently authenticated user as the sender.
11
12 The XML for the new message is returned on a successful request.
13
14 The valid types are:
15
16 * `TextMessage` (regular chat message),
17 * `PasteMessage` (pre-formatted message, rendered in a fixed-width font),
947e37c @rocketslide Update sections/messages.md
rocketslide authored
18 * `SoundMessage` (plays a sound as determined by the message, which can be `56k`, `bueller`, `crickets`, `dangerzone`, `deeper`,`drama`, `greatjob`, `horn`, `horror`,`inconceivable`,
38f7f4c @mlafeldt Document more sounds
mlafeldt authored
19 `live`, `loggins`, `noooo`, `nyan`, `ohmy`, `ohyeah`, `pushit`, `rimshot`, `sax`, `secret`, `tada`, `tmyk`, `trombone`, `vuvuzela`, `yeah`, or `yodel`)
93a063f @qrush first few sections of campfire api
qrush authored
20 * `TweetMessage` (a Twitter status URL to be fetched and inserted into the chat)
47315fa @jordanekay Fix ironically missing line break
jordanekay authored
21
93a063f @qrush first few sections of campfire api
qrush authored
22 If an explicit type is omitted, it will be inferred from the content (e.g., if the message contains new line characters, it will be considered a paste).
23
24 Newline characters are ignored for TextMessages. In order to include newlines inside of a PasteMessage, use this escape code: `
`
25
26 **Request:**
27
28 ``` xml
29 <message>
30 <type>TextMessage</type>
31 <body>Hello</body>
32 </message>
33 ```
34
35 **Response:**
36
37 Status: 201 Created
38
39 ``` xml
40 <message>
41 <id type="integer">1</id>
42 <body>Hello</body>
43 <room-id type="integer">1</room-id>
44 <user-id type="integer">2</user-id>
45 <created-at type="datetime">2009-11-22T19:11:41Z</created-at>
46 <type>TextMessage</type>
47 <starred>false</starred>
48 </message>
49 ```
50
51 Get recent messages
52 -------------------
53
54 * `GET /room/#{id}/recent.xml` returns a collection of upto 100 recent messages in the room.
55
56 This endpoint accepts two additional optional parameters: `limit` to restrict the number of messages returned and `since_message_id` to get messages created after the specified message id.
57
58 **Response:**
59
60 ``` xml
61 <messages type="array">
62 <message>
63 <created-at type="datetime">2010-04-15T11:03:08Z</created-at>
64 <id type="integer">23</id>
65 <room-id type="integer">1</room-id>
66 <user-id type="integer">1</user-id>
67 <body>Hello room!</body>
68 <type>TextMessage</type>
69 <starred>false</starred>
70 </message>
71 ...
72 </messages>
73 ```
74
75
76 Highlight message
77 -----------------
78
79 * `POST /messages/#{message_id}/star.xml` highlights a message in the room's transcript
80
81 **Response:**
82
83 Status: 200 OK
84
85
86 Unhighlight message
87 -------------------
88
89 * `DELETE /messages/#{message_id}/star.xml` removes a message highlight from the room's transcript
90
91 **Response:**
92
93 Status: 200 OK
Something went wrong with that request. Please try again.