操作
文件¶
/projects/:project_id/files.:format¶
GET¶
返回给定 id 或标识符的项目中可用的文件。
示例:
GET /projects/foo/files.xml GET /projects/1/files.xml
响应:
<?xml version="1.0" encoding="UTF-8"?>
<files type="array">
<file>
<id>12</id>
<filename>foo-1.0-setup.exe</filename>
<filesize>74753799</filesize>
<content_type>application/octet-stream</content_type>
<description>Foo App for Windows</description>
<content_url>https://127.0.0.1:3000/attachments/download/12/foo-1.0-setup.exe</content_url>
<author id="1" name="Redmine Admin"/>
<created_on>2017-01-04T09:12:32Z</created_on>
<version id="2" name="1.0"/>
<digest>1276481102f218c981e0324180bafd9f</digest>
<downloads>12</downloads>
</file>
<file>
<id>11</id>
<filename>foo-1.0.dmg</filename>
<filesize>6886287</filesize>
<content_type>application/x-octet-stream</content_type>
<description>Foo App for macOS</description>
<content_url>https://127.0.0.1:3000/attachments/download/11/foo-1.0.dmg</content_url>
<author id="1" name="Redmine Admin"/>
<created_on>2017-01-04T09:12:07Z</created_on>
<version id="2" name="1.0"/>
<digest>14758f1afd44c09b7992073ccf00b43d</digest>
<downloads>5</downloads>
</file>
</files>
POST¶
为给定 id 或标识符的项目上传文件。
参数:
file
(必需):版本属性的哈希,包括token
(必需):上传文件的令牌。见附加文件。version_id
filename
description
示例:
POST /projects/1/files.xml
响应:
<?xml version="1.0"?>
<file>
<token>21.01a1d7b1c2ffcbbc9ecf14debeec27d8</token>
<version_id>2</version_id>
<filename>foo-1.0-src.tar.tgz</filename>
<description>Foo App source code</description>
</file>
最后更新于 Mischa The Evil 7 年前 · 4 次修订