Permalink
Browse files

First draft of Files page and some updates to other file docs related…

… to files
  • Loading branch information...
1 parent 0b3e007 commit 7232a09b44ad7c98746255470bd2de6d96f9fb4f Antti Pitkanen committed Mar 5, 2012
Showing with 28 additions and 5 deletions.
  1. +23 −0 docs/Files.md
  2. +5 −5 docs/Message-Types.md
View
@@ -0,0 +1,23 @@
+# Files
+
+## List files
+
+Messages containing files can be fetched by filtering messages by type `file` or using special tag `:file` in tag filtering. See [Messages](Messages) documentation for details.
+
+## Retrieve single file
+
+The REST API path of a file is stored in `path` field of each attachment. The API path is of the following format: `/flows/:org/:flow/files/:uuid/:filename`.
+
+```
+GET /flows/:org/:flow/files/:uuid/:filename
+```
+
+### Response
+```
+HTTP/1.1 200 OK
+Flowdock-User: 2
+Content-Length: 10931
+Content-Type: application/octet-stream
+
+_DATA_
+```
View
@@ -207,23 +207,23 @@ timestamp is not always present when e.g. user is idle.
The file event represents a file upload to chat.
### Data
-`content` is a hash containing metadata about the uploaded file. The `attachments` field will contain a single attachment with the same data.
+`content` is a hash containing metadata about the uploaded file. The `attachments` field will contain a single attachment with the same data. Inside each attachment the `path` field contains the REST API path of the file.
### Sample
```javascript
{
- "path":"/flows/main/files/de0eca404387012ff4661093e90ad632/fubuki menu.pdf",
- "file_name":"fubuki_menu.pdf",
+ "path": "/flows/org/main/files/de0eca404387012ff4661093e90ad632/screenshot.png",
+ "file_name": "screenshot.png",
"image": {
"width": 384,
"height": 271
},
"file_size": 1375305,
- "content_type": "application\/pdf",
+ "content_type": "image/png",
"thumbnail": {
"width": 100,
"height": 71,
- "path":"/flows/hauska-flowi/files/de0eca404387012ff4661093e90ad632/thumb/fubuki menu.pdf"
+ "path": "/flows/org/main/files/de0eca404387012ff4661093e90ad632/thumb/screenshot.png"
}
}
```

0 comments on commit 7232a09

Please sign in to comment.