Rest Files » History » Version 2
Toshi MARUYAMA, 2017-01-11 17:51
use XML code syntax highlighting
1 | 1 | Go MAEDA | h1. Files |
---|---|---|---|
2 | |||
3 | {{>toc}} |
||
4 | |||
5 | h2. /projects/:project_id/files.:format |
||
6 | |||
7 | h3. GET |
||
8 | |||
9 | Returns the files available for the project of given id or identifier (:project_id). |
||
10 | |||
11 | +Examples+: |
||
12 | |||
13 | <pre> |
||
14 | GET /projects/foo/files.xml |
||
15 | GET /projects/1/files.xml |
||
16 | </pre> |
||
17 | |||
18 | +Response+: |
||
19 | |||
20 | 2 | Toshi MARUYAMA | <pre><code class="xml"> |
21 | 1 | Go MAEDA | <?xml version="1.0" encoding="UTF-8"?> |
22 | <files type="array"> |
||
23 | <file> |
||
24 | <id>12</id> |
||
25 | <filename>foo-1.0-setup.exe</filename> |
||
26 | <filesize>74753799</filesize> |
||
27 | <content_type>application/octet-stream</content_type> |
||
28 | <description>Foo App for Windows</description> |
||
29 | <content_url>http://localhost:3000/attachments/download/12/foo-1.0-setup.exe</content_url> |
||
30 | <author id="1" name="Redmine Admin"/> |
||
31 | <created_on>2017-01-04T09:12:32Z</created_on> |
||
32 | <version id="2" name="1.0"/> |
||
33 | <digest>1276481102f218c981e0324180bafd9f</digest> |
||
34 | <downloads>12</downloads> |
||
35 | </file> |
||
36 | <file> |
||
37 | <id>11</id> |
||
38 | <filename>foo-1.0.dmg</filename> |
||
39 | <filesize>6886287</filesize> |
||
40 | <content_type>application/x-octet-stream</content_type> |
||
41 | <description>Foo App for macOS</description> |
||
42 | <content_url>http://localhost:3000/attachments/download/11/foo-1.0.dmg</content_url> |
||
43 | <author id="1" name="Redmine Admin"/> |
||
44 | <created_on>2017-01-04T09:12:07Z</created_on> |
||
45 | <version id="2" name="1.0"/> |
||
46 | <digest>14758f1afd44c09b7992073ccf00b43d</digest> |
||
47 | <downloads>5</downloads> |
||
48 | </file> |
||
49 | </files> |
||
50 | 2 | Toshi MARUYAMA | </code></pre> |
51 | 1 | Go MAEDA | |
52 | h3. POST |
||
53 | |||
54 | Upload a file for the project of given id or identifier (:project_id). |
||
55 | |||
56 | +Parameters+: |
||
57 | |||
58 | * @file@ (required): a hash of the version attributes, including: |
||
59 | |||
60 | * @token@ (required): a token for your uploaded file. See [[Rest_api#Attaching-files|Attaching files]]. |
||
61 | * @version_id@ |
||
62 | * @filename@ |
||
63 | * @description@ |
||
64 | |||
65 | +Examples+: |
||
66 | |||
67 | <pre> |
||
68 | POST /projects/1/files.xml |
||
69 | <?xml version="1.0"?> |
||
70 | <file> |
||
71 | <token>21.01a1d7b1c2ffcbbc9ecf14debeec27d8</token> |
||
72 | <version_id>2</version_id> |
||
73 | <filename>foo-1.0-src.tar.tgz</filename> |
||
74 | <description>Foo App source code</description> |
||
75 | </file> |
||
76 | </pre> |